Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database
Class JDBCTransaction

java.lang.Object
  extended by com.jivesoftware.base.database.JDBCTransaction
All Implemented Interfaces:
Transaction

public class JDBCTransaction
extends java.lang.Object
implements Transaction


Constructor Summary
JDBCTransaction(java.sql.Connection con)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCTransaction

public JDBCTransaction(java.sql.Connection con)
Method Detail

commit

public void commit()
Description copied from interface: Transaction
Commits the current transaction, this will also close the underlying connection.

Specified by:
commit in interface Transaction

rollback

public void rollback()
Description copied from interface: Transaction
Rollback the current transaction, this will also close the underlying connection.

Specified by:
rollback in interface Transaction

wasRolledBack

public boolean wasRolledBack()
Description copied from interface: Transaction
Returns true if the transaction was rolled back, false otherwise

Specified by:
wasRolledBack in interface Transaction
Returns:
true if the transaction was rolled back, false otherwise

wasCommitted

public boolean wasCommitted()
Description copied from interface: Transaction
Returns true if the transaction was committed, false otherwise

Specified by:
wasCommitted in interface Transaction
Returns:
true if the transaction was committed, false otherwise

isActive

public boolean isActive()
Description copied from interface: Transaction
Returns true if the transaction is active, false otherwise

Specified by:
isActive in interface Transaction
Returns:
true if the transaction is active, false otherwise

isExistingTransaction

public boolean isExistingTransaction()
Description copied from interface: Transaction
Returns true if the transaction was previously started, false otherwise

Specified by:
isExistingTransaction in interface Transaction
Returns:
true if the transaction was previously started, false otherwise

addListener

public void addListener(java.lang.Runnable runnable)
Description copied from interface: Transaction
Add a runnable to be run when the transaction is committed. If the transaction is rolled back the runnables will not be run.

Specified by:
addListener in interface Transaction
Parameters:
runnable - the Runnable to be run when the transaction is completed.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.