JDBaccess API 1.0

com.jdbaccess.da
Interface Transaction


public interface Transaction

A transaction is similar to a database session. You start a transaction (get a separate database connection), perform a sequence of database access operations (statements) on it and if no error has occurred you commit it else you rollback it. Finally you end your transaction.

Examples:
 You start a transcation by:
   Transaction t = DAReader.getTransaction();
   t.begin();
 You commit a transcation by:
   t.commit();
 You rollback a transcation back by:
   t.rollback();
 You end a transcation by:
   t.end();
 
If you begin a transaction you should not forget the commit and end of that transaction so that the underlying database connection can be reused. If you begin a transaction a database connection is fetched from internal connection pool exclusive for that transaction. If you finish your transaction the underlying database connection is returned back to the connection pool for reuse.


Method Summary
 void begin()
          Begins a transaction.
 void commit()
          Commit of this transaction
 void end()
          Ends a transaction.
 void rollback()
          Rollback of this transaction
 

Method Detail

begin

void begin()
           throws ApplicationException
Begins a transaction. A connection is fetched exclusive from connection pool.

Throws:
ApplicationException

end

void end()
         throws ApplicationException
Ends a transaction. The underlying connection is returned back to the connection pool for reuse

Throws:
ApplicationException

commit

void commit()
            throws ApplicationException
Commit of this transaction

Throws:
ApplicationException

rollback

void rollback()
              throws ApplicationException
Rollback of this transaction

Throws:
ApplicationException

JDBaccess API 1.0

Copyright © 2005-2006 JDBaccess.com, Königsweg 210, D-14129 Berlin, Germany. All Rights Reserved.