com.im.commons.db 5.9.2

com.im.commons.db.util
Class ConnectionHandlerSupport

java.lang.Object
  extended by com.im.commons.db.util.ConnectionHandlerSupport

public final class ConnectionHandlerSupport
extends Object


Constructor Summary
ConnectionHandlerSupport()
           
 
Method Summary
static ConnectionHandler prepareConnectionHandler(DataSource dataSource, String jchemPropertiesTableName)
          TODO - this javadoc seems wrong.
static ConnectionHandler prepareConnectionHandler2(DataSource dataSource, String jchemPropertiesTableName)
          Generate a ConnectionHandler.
static ConnectionHandler prepareConnectionHandlerMutliConnectionNoTx(DataSource dataSource, String schemaPlusProptable)
          Special case of creating a ConnectionHandler that only has connection details, not an actual physical connection.
static void releaseConnectionHandler(ConnectionHandler ch, DataSource src)
          Helper that releases the connection handler.
static void releaseConnectionHandler(ConnectionHandler ch, DataSource src, String msg1, String msg2)
           
static Connection unwrapConnection(Connection c)
          Unwraps the connection to the underlying raw one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionHandlerSupport

public ConnectionHandlerSupport()
Method Detail

releaseConnectionHandler

public static void releaseConnectionHandler(ConnectionHandler ch,
                                            DataSource src)
Helper that releases the connection handler. It is just to centralize the processing


releaseConnectionHandler

public static void releaseConnectionHandler(ConnectionHandler ch,
                                            DataSource src,
                                            String msg1,
                                            String msg2)

unwrapConnection

public static Connection unwrapConnection(Connection c)
Unwraps the connection to the underlying raw one. Registers the wrapper vs. raw pair, so the wrapper can be looked up from the wrapper - use popConnectionWrapper(java.sql.Connection). The connection can have only one wrapper registered at a time; more wrappers will cause a sanity check assertion.


prepareConnectionHandler

public static ConnectionHandler prepareConnectionHandler(DataSource dataSource,
                                                         String jchemPropertiesTableName)
TODO - this javadoc seems wrong. Connection is completely unwrapped? Prepares the ConnectionHandler. It uses Spring DataSourceUtils to obtain the connection, it does not directly pull Connection from the DataSource. In the case that a transaction is active, it wraps the Connection with a proxy that suppresses close() so that accidental call to ConnectionHandler.close() does no damage. Use releaseConnectionHandler(chemaxon.util.ConnectionHandler, javax.sql.DataSource) to release resources associated with the ConnectionHandler including the connection


prepareConnectionHandler2

public static ConnectionHandler prepareConnectionHandler2(DataSource dataSource,
                                                          String jchemPropertiesTableName)
Generate a ConnectionHandler. The connection is one obtained from the DataSource. WARNING: ConnectionHandler created in this way MUST be closed using ConnectionHandler.close().

Parameters:
dataSource -
jchemPropertiesTableName -

prepareConnectionHandlerMutliConnectionNoTx

public static ConnectionHandler prepareConnectionHandlerMutliConnectionNoTx(DataSource dataSource,
                                                                            String schemaPlusProptable)
Special case of creating a ConnectionHandler that only has connection details, not an actual physical connection. This is useful as it allows JChem to created new connections as it needs so that it can use multiple threads for things like Chemical terms column calculations and table regeneration. WARNING: ConnectionHandler created in this way MUST be closed using ConnectionHandler.close().

Parameters:
dataSource -
schemaPlusProptable -

com.im.commons.db 5.9.2