sqlg2.db
Class SingleConnectionManager

java.lang.Object
  extended by sqlg2.db.SingleConnectionManager
All Implemented Interfaces:
ConnectionManager

public class SingleConnectionManager
extends java.lang.Object
implements ConnectionManager

Single-connection implementation of ConnectionManager. This class is thread-safe and when one thread is using connection others have to wait.


Constructor Summary
SingleConnectionManager(java.sql.Connection conn)
           
 
Method Summary
 java.sql.Connection allocConnection(boolean simpleTransaction)
          Connection allocation.
 void close()
          Closing all connections and releasing all resources.
 void releaseConnection(java.sql.Connection conn)
          Connection release.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleConnectionManager

public SingleConnectionManager(java.sql.Connection conn)
Method Detail

allocConnection

public java.sql.Connection allocConnection(boolean simpleTransaction)
                                    throws java.sql.SQLException
Description copied from interface: ConnectionManager
Connection allocation.

Specified by:
allocConnection in interface ConnectionManager
Parameters:
simpleTransaction - true if connection is allocated for simple transaction. Can be used to prevent deadlocks between transactions.
Throws:
java.sql.SQLException

releaseConnection

public void releaseConnection(java.sql.Connection conn)
Description copied from interface: ConnectionManager
Connection release.

Specified by:
releaseConnection in interface ConnectionManager

close

public void close()
           throws java.sql.SQLException
Description copied from interface: ConnectionManager
Closing all connections and releasing all resources.

Specified by:
close in interface ConnectionManager
Throws:
java.sql.SQLException