hu.netmind.beankeeper
Interface Transaction

All Superinterfaces:
java.util.Map

public interface Transaction
extends java.util.Map

This is a high-level transaction object used throughout the persistence layer. Also, it can store attributes, which can be used to communicate data through calling layers.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 void begin()
          Start the transaction.
 void commit()
          Commit a transaction.
 java.sql.Connection getConnection()
          Get the connection to the database from this transaction.
 java.lang.Long getEndSerial()
          Get the serial when this transaction ended.
 java.lang.Long getSerial()
          Get the serial number when this transaction began.
 DatabaseStatistics getStats()
          Get statistics from this transaction.
 boolean isRollbackOnly()
          Returns whether this transaction was marked "rollback only".
 void markRollbackOnly()
          Mark this transaction as rollback only.
 void rollback()
          Rollback this transaction.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

begin

void begin()
Start the transaction. A transaction must be always start with the call to begin(). All subsequent calls to this method will increase the transaction depth, and to commit the transaction exactly that many commit() and rollback() calls must occur.


commit

void commit()
Commit a transaction.


rollback

void rollback()
Rollback this transaction.


markRollbackOnly

void markRollbackOnly()
Mark this transaction as rollback only. This means the next call to either commit or rollback will rollback either way.


isRollbackOnly

boolean isRollbackOnly()
Returns whether this transaction was marked "rollback only".


getSerial

java.lang.Long getSerial()
Get the serial number when this transaction began.


getEndSerial

java.lang.Long getEndSerial()
Get the serial when this transaction ended. This is also the unique moment in time when all changes became visible.

Returns:
The end serial. This may be null, if the end of transaction is not yet known.

getStats

DatabaseStatistics getStats()
Get statistics from this transaction.


getConnection

java.sql.Connection getConnection()
Get the connection to the database from this transaction.