Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database
Interface Transaction

All Known Implementing Classes:
JDBCTransaction

public interface Transaction

A represents a database transaction.


Method Summary
 void addListener(java.lang.Runnable runnable)
          Add a runnable to be run when the transaction is committed.
 void commit()
          Commits the current transaction, this will also close the underlying connection.
 boolean isActive()
          Returns true if the transaction is active, false otherwise
 boolean isExistingTransaction()
          Returns true if the transaction was previously started, false otherwise
 void rollback()
          Rollback the current transaction, this will also close the underlying connection.
 boolean wasCommitted()
          Returns true if the transaction was committed, false otherwise
 boolean wasRolledBack()
          Returns true if the transaction was rolled back, false otherwise
 

Method Detail

commit

void commit()
Commits the current transaction, this will also close the underlying connection.

Throws:
TransactionException - thrown if there are problems committing the transaction

rollback

void rollback()
Rollback the current transaction, this will also close the underlying connection.

Throws:
TransactionException - thrown if there are problems committing the transaction

wasRolledBack

boolean wasRolledBack()
Returns true if the transaction was rolled back, false otherwise

Returns:
true if the transaction was rolled back, false otherwise

wasCommitted

boolean wasCommitted()
Returns true if the transaction was committed, false otherwise

Returns:
true if the transaction was committed, false otherwise

isActive

boolean isActive()
Returns true if the transaction is active, false otherwise

Returns:
true if the transaction is active, false otherwise

isExistingTransaction

boolean isExistingTransaction()
Returns true if the transaction was previously started, false otherwise

Returns:
true if the transaction was previously started, false otherwise

addListener

void addListener(java.lang.Runnable runnable)
Add a runnable to be run when the transaction is committed. If the transaction is rolled back the runnables will not be run.

Parameters:
runnable - the Runnable to be run when the transaction is completed.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.