public class ConnectionManagerImpl extends Object implements ConnectionManager
Connections can be locked per ExecutionContext 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.
Constructor and Description |
---|
ConnectionManagerImpl(PersistenceNucleusContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ManagedConnection |
allocateConnection(ConnectionFactory factory,
ExecutionContext ec,
Transaction transaction,
Map options)
Method to return a connection for this ExecutionContext.
|
void |
closeAllConnections(ConnectionFactory factory,
ExecutionContext ec)
Method to close all pooled connections for the specified key of the specified factory.
|
void |
disableConnectionPool()
Disable binding objects to ExecutionContext references, so automatically
disables the connection pooling
|
ConnectionFactory |
lookupConnectionFactory(String name)
Method to lookup a connection factory and create it if not yet existing.
|
void |
registerConnectionFactory(String name,
ConnectionFactory factory)
Method to register a connection factory under a name.
|
public ConnectionManagerImpl(PersistenceNucleusContext context)
context
- Context for this manager.public void closeAllConnections(ConnectionFactory factory, ExecutionContext ec)
closeAllConnections
in interface ConnectionManager
factory
- The factoryec
- The key in the poolpublic ManagedConnection allocateConnection(ConnectionFactory factory, ExecutionContext ec, Transaction transaction, Map options)
allocateConnection
in interface ConnectionManager
factory
- ConnectionFactory it relates toec
- Key in the pooloptions
- Options for the connection (e.g isolation). These will override those of the txn itselftransaction
- The transactionpublic ConnectionFactory lookupConnectionFactory(String name)
lookupConnectionFactory
in interface ConnectionManager
name
- The lookup name "e.g "jdbc/tx"public void registerConnectionFactory(String name, ConnectionFactory factory)
registerConnectionFactory
in interface ConnectionManager
name
- The lookup name "e.g "jdbc/tx"factory
- The connection factorypublic void disableConnectionPool()
disableConnectionPool
in interface ConnectionManager
Copyright © 2017. All rights reserved.