|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.connection.ConnectionManagerImpl
public class ConnectionManagerImpl
Manager of connections for a datastore, allowing ManagedConnection pooling, enlistment in transaction. The pool caches one connection per poolKey object. 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. 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.
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
Localisation of messages. |
| Constructor Summary | |
|---|---|
ConnectionManagerImpl(OMFContext omfContext)
Constructor. |
|
| Method Summary | |
|---|---|
ManagedConnection |
allocateConnection(ConnectionFactory factory,
java.lang.Object poolKey,
Transaction transaction,
java.util.Map options)
Method to return a connection for this "poolKey". |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
| Constructor Detail |
|---|
public ConnectionManagerImpl(OMFContext omfContext)
omfContext - OMFContext for this manager.| Method Detail |
|---|
public void closeAllConnections(ConnectionFactory factory,
java.lang.Object poolKey)
closeAllConnections in interface ConnectionManagerfactory - The factorypoolKey - The key in the pool
public ManagedConnection allocateConnection(ConnectionFactory factory,
java.lang.Object poolKey,
Transaction transaction,
java.util.Map options)
allocateConnection in interface ConnectionManagerfactory - ConnectionFactory it relates topoolKey - the object that is bound the connection during its lifecycleoptions - Options for the connection (e.g isolation). These will override those of the txn itself
public ConnectionFactory lookupConnectionFactory(java.lang.String name)
lookupConnectionFactory in interface ConnectionManagername - The lookup name "e.g "jdbc/tx"
public void registerConnectionFactory(java.lang.String name,
ConnectionFactory factory)
registerConnectionFactory in interface ConnectionManagername - The lookup name "e.g "jdbc/tx"factory - The connection factorypublic void disableConnectionPool()
disableConnectionPool in interface ConnectionManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||