Arch4J 1.1

org.arch4j.dataaccess
Class TransactionalConnectionManager

java.lang.Object
  |
  +--org.arch4j.dataaccess.TransactionalConnectionManager

public class TransactionalConnectionManager
extends Object

This class allows for transactional bounding around multiple calls over a single database connection.


Method Summary
 Connection getConnection()
          Create a connection if this is the first action of the transaction, otherwise return the existing connection.
static TransactionalConnectionManager getTransactionalConnectionManager(org.arch4j.dataaccess.ConnectionManager aConnectionManager)
          Provides singleton instances of this class per thread.
 boolean isMarkedForRollback()
          Knows if the current or just executed transaction is marked for rollback.
 void markForRollback()
          If this method is called at any time the transaction will rollback when endTransaction() is called.
 void releaseConnection()
          Release the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTransactionalConnectionManager

public static TransactionalConnectionManager getTransactionalConnectionManager(org.arch4j.dataaccess.ConnectionManager aConnectionManager)
Provides singleton instances of this class per thread. Only local references should be made to instances returned by this method. Instances should be accessed by only one thread.


getConnection

public Connection getConnection()
                         throws SQLException
Create a connection if this is the first action of the transaction, otherwise return the existing connection. This method must be paired with a call to releaseConnection() using a finally block.

SQLException

releaseConnection

public void releaseConnection()
                       throws SQLException
Release the connection. If this is paired with the call to getConnection that initiated the transaction then commit or rollback.

SQLException

markForRollback

public void markForRollback()
If this method is called at any time the transaction will rollback when endTransaction() is called. In other words, it will never commit.


isMarkedForRollback

public boolean isMarkedForRollback()
Knows if the current or just executed transaction is marked for rollback.


Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.