public interface 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.
Modifier and Type | Method and Description |
---|---|
ManagedConnection |
allocateConnection(ConnectionFactory factory,
ExecutionContext ec,
Transaction tx,
Map options)
Allocate a connection using the specified factory (unless we already have one cached for the 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
|
ConnectionFactory lookupConnectionFactory(String name)
name
- The lookup name "e.g "jdbc/tx"void registerConnectionFactory(String name, ConnectionFactory factory)
name
- The lookup name "e.g "jdbc/tx"factory
- The connection factoryvoid closeAllConnections(ConnectionFactory factory, ExecutionContext ec)
factory
- The factoryec
- The key in the poolManagedConnection allocateConnection(ConnectionFactory factory, ExecutionContext ec, Transaction tx, Map options)
factory
- The ConnectionFactory to create any new connection withec
- ExecutionContext that binds the connection during its lifetime (key in the pool)tx
- The transactionoptions
- Any overriding options for allocating the connection (e.g isolation) that override the transaction (default) optionsvoid disableConnectionPool()
Copyright © 2017. All rights reserved.