public class ConnectionFactoryImpl
extends org.datanucleus.store.connection.AbstractConnectionFactory
When an ODB is obtained for an ExecutionContext, it is cached so all subsequent uses for that ExecutionContext will have the same ODB. This means that the ODB is aligned with the transaction, and so we can use commit/rollback on the ODB. When the txn commits we still have the ODB in the cache so if a subsequent txn starts on the same ExecutionContext it will then have the same ODB. When the ExecutionContext is closed the ODB is finally closed.
Modifier and Type | Field and Description |
---|---|
protected HashMap |
odbByExecutionContext
Cache of the NeoDatis ODB keyed by ExecutionContext.
|
Constructor and Description |
---|
ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr,
String resourceType)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
closeODBForExecutionContext(Object poolKey)
Convenience method to notify the factory that the specified ExecutionContext is closing, so to close
any resources for it.
|
org.datanucleus.store.connection.ManagedConnection |
createManagedConnection(org.datanucleus.ExecutionContext ec,
Map txnOptionsIgnored)
Method to create a new managed connection.
|
protected org.neodatis.odb.ODB |
getNewODB()
Convenience method to create a new ODB for this datastore.
|
protected HashMap odbByExecutionContext
public ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr, String resourceType)
storeMgr
- Store ManagerresourceType
- Type of resource (tx, nontx)public void closeODBForExecutionContext(Object poolKey)
poolKey
- Key for the connection poolprotected org.neodatis.odb.ODB getNewODB()
public org.datanucleus.store.connection.ManagedConnection createManagedConnection(org.datanucleus.ExecutionContext ec, Map txnOptionsIgnored)
ec
- Key for the pooltxnOptionsIgnored
- Transaction optionsCopyright © 2016. All rights reserved.