BEA Systems, Inc.

BEA WebLogic Server 9.0 API Reference

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); // 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:
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


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 followed by tlog.checkpoint() sequence should guarantee the object is actually on disk, even if the store() operation put it in the pending buffer.


public int getInitialRecoveredTransactionTotalCount()


public String getMigratedCoordinatorURL()


public int getRecoveredTransactionCompletionCount()


public boolean hasTransactionLogRecords()


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.

obj - object to release from transaction log memory


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.

obj - object to store in transaction log

Documentation is available at
Copyright 2005 BEA Systems Inc.