|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectionManager
Manager of connections for a StoreManager, allowing ManagedConnection pooling, enlistment in transaction. The pool caches one connection per poolKey object. The poolKey is typically the ExecutionContext (ObjectManager). The allocateConnection method can create connections and enlist them (like most normal persistence operations need) or create a connection and return it without enlisting it into a transaction, for example the connections used to generate object identity, create the database schema or obtaining the schema metadata. The closeAllConnections method is typically called when the owning object (ExecutionContext) is being closed giving us chance to close all retained connections for that poolKey.
Connections can be locked per object poolKey basis. Locking of connections is used to handle the connection over to the user application. A locked connection denies any further access to the datastore, until the user application unlock it.
| Method Summary | |
|---|---|
ManagedConnection |
allocateConnection(ConnectionFactory factory,
java.lang.Object poolKey,
Transaction tx,
java.util.Map options)
Allocate a connection using the specified factory (unless we already have one cached for the poolKey object). |
void |
closeAllConnections(ConnectionFactory factory,
java.lang.Object poolKey)
Method to close all pooled connections for the specified key of the specified factory. |
void |
disableConnectionPool()
Disable binding objects to "poolKey" references, so automatically disables the connection pooling |
ConnectionFactory |
lookupConnectionFactory(java.lang.String name)
Method to lookup a connection factory and create it if not yet existing. |
void |
registerConnectionFactory(java.lang.String name,
ConnectionFactory factory)
Method to register a connection factory |
| Method Detail |
|---|
ConnectionFactory lookupConnectionFactory(java.lang.String name)
name - The lookup name "e.g "jdbc/tx"
void registerConnectionFactory(java.lang.String name,
ConnectionFactory factory)
name - The lookup name "e.g "jdbc/tx"factory - The connection factory
void closeAllConnections(ConnectionFactory factory,
java.lang.Object poolKey)
factory - The factorypoolKey - The key in the pool
ManagedConnection allocateConnection(ConnectionFactory factory,
java.lang.Object poolKey,
Transaction tx,
java.util.Map options)
factory - The ConnectionFactory to create any new connection withpoolKey - the object that is bound the connection during its lifecycleoptions - Any options for allocating the connection (e.g isolation)
void disableConnectionPool()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||