BEA Systems, Inc.

BEA WebLogic Server 9.0 API Reference


weblogic.transaction
Interface TransactionLogger


public interface TransactionLogger

Transaction log manager for two-phase commit.

A TransactionLogger accepts TransactionLoggable objects for asynchronous storage on disk in the transaction log, and drives their life cycle transitions (releasing and/or recovery).

Normal life-cycle of this object: // Normal initialization t = new TransactionLogger(); // Performs recovery too // Normal operation (repeat as many times as necessary) t.store(obj); // Request some object to be stored on disk obj.onDisk(); // Object's callback gets invoked t.release(obj); // Release object when no longer needed // Prepare for normal shutdown t.checkpoint();

See Also:
TransactionLoggable
Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

Method Summary
 void checkpoint()
          Perform a log checkpoint operation.
 int getInitialRecoveredTransactionTotalCount()
           
 String getMigratedCoordinatorURL()
           
 int getRecoveredTransactionCompletionCount()
           
 boolean hasTransactionLogRecords()
           
 void release(TransactionLoggable obj)
          Release an object previously stored.
 void store(TransactionLoggable obj)
          Accept an object for storage in the transaction log file.
 

Method Detail

checkpoint

public void checkpoint()
Perform a log checkpoint operation.

A checkpoint operation releases unneeded disk space and helps improve crash recovery time. It is recommended to perform a checkpoint before a controlled system shutdown.

The caller's thread is blocked until all objects previously stored in the transaction log have been written to disk. Note that this might involve more than one disk-level checkpoint. A tlog.store() followed by tlog.checkpoint() sequence should guarantee the object is actually on disk, even if the store() operation put it in the pending buffer.


getInitialRecoveredTransactionTotalCount

public int getInitialRecoveredTransactionTotalCount()

getMigratedCoordinatorURL

public String getMigratedCoordinatorURL()

getRecoveredTransactionCompletionCount

public int getRecoveredTransactionCompletionCount()

hasTransactionLogRecords

public boolean hasTransactionLogRecords()

release

public void release(TransactionLoggable obj)
Release an object previously stored.

Once an object previously stored in the transaction log is released, the TransactionLogger is no longer responsible for processing that object during recovery.

Failure to release objects may result in unnecessarily large transaction log files and long recovery times.

An object may need to be released more than once, for example both before and after recovery. Any extra releases are ignored.

Parameters:
obj - object to release from transaction log memory

store

public void store(TransactionLoggable obj)
Accept an object for storage in the transaction log file.

This method returns after the loggable object has been externalized, but possibly before the IO operation is complete. When the object's external representation is safely on disk, the object's onDisk() callback method is invoked. The object MIGHT NOT BE ON DISK by the time store() returns. This allows the current thread to be available for reuse while waiting for disk I/O.

Transaction log file store operations are ordered: if one object is stored before another, it will be placed in the log first, and will be processed in the same order during recovery.

The caller is responsible for releasing the stored object, by calling this class's release() method, at a later time.

An object should not be stored more than once.

Parameters:
obj - object to store in transaction log

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs90
Copyright 2005 BEA Systems Inc.