jdbm.recman
Class TransactionManager

java.lang.Object
  extended by jdbm.recman.TransactionManager

public final class TransactionManager
extends java.lang.Object

This class manages the transaction log that belongs to every RecordFile. The transaction log is either clean, or in progress. In the latter case, the transaction manager takes care of a roll forward.

Implementation note: this is a proof-of-concept implementation which hasn't been optimized for speed. For instance, all sorts of streams are created for every transaction.


Nested Class Summary
static class TransactionManager.BlockIoComparator
          INNER CLASS.
 
Method Summary
 void setMaximumTransactionsInLog(int maxTxns)
          Set the maximum number of transactions to record in the log (and keep in memory) before the log is synchronized with the main database file.
 void synchronizeLog()
          Synchronize log file data with the main database file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

synchronizeLog

public void synchronizeLog()
                    throws java.io.IOException
Synchronize log file data with the main database file.

After this call, the main database file is guaranteed to be consistent and guaranteed to be the only file needed for backup purposes.

Throws:
java.io.IOException

setMaximumTransactionsInLog

public void setMaximumTransactionsInLog(int maxTxns)
                                 throws java.io.IOException
Set the maximum number of transactions to record in the log (and keep in memory) before the log is synchronized with the main database file.

This method must be called while there are no pending transactions in the log.

Throws:
java.io.IOException


Cees de Groot (C) 2000. All rights reserved http://jdbm.sourceforge.net