|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.neodatis.ConnectionFactoryImpl
public class ConnectionFactoryImpl
Implementation of a ConnectionFactory for NeoDatis. Obtains access to the NeoDatis ODB supporting use of
When an ODB is obtained for an ObjectManager, it is cached so all subsequent uses for that ObjectManager 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 ObjectManager it will then have the same ODB. When the ObjectManager is closed the ODB is finally closed.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER_NEODATIS
Localiser for messages. |
protected java.util.HashMap |
odbByObjectManager
Cache of the NeoDatis ODB keyed by ObjectManager. |
| Fields inherited from interface org.datanucleus.ConnectionFactory |
|---|
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE, RESOURCE_TYPE_OPTION |
| Constructor Summary | |
|---|---|
ConnectionFactoryImpl(org.datanucleus.OMFContext omfContext,
java.lang.String resourceType)
Constructor |
|
| Method Summary | |
|---|---|
void |
closeODBForObjectManager(org.datanucleus.ObjectManager om)
Convenience method to notify the factory that the specified ObjectManager is closing, so to close any resources for it. |
org.datanucleus.ManagedConnection |
createManagedConnection(org.datanucleus.ObjectManager om,
java.util.Map options)
Method to create a new managed connection. |
org.datanucleus.ManagedConnection |
getConnection(org.datanucleus.ObjectManager om,
java.util.Map options)
Method to get a managed connection enlisting it in the transaction. |
protected org.neodatis.odb.ODB |
getNewODB()
Convenience method to create a new ODB for this datastore. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER_NEODATIS
protected java.util.HashMap odbByObjectManager
| Constructor Detail |
|---|
public ConnectionFactoryImpl(org.datanucleus.OMFContext omfContext,
java.lang.String resourceType)
omfContext - The OMF contextresourceType - Type of resource (tx, nontx)| Method Detail |
|---|
public void closeODBForObjectManager(org.datanucleus.ObjectManager om)
om - ObjectManagerprotected org.neodatis.odb.ODB getNewODB()
public org.datanucleus.ManagedConnection getConnection(org.datanucleus.ObjectManager om,
java.util.Map options)
getConnection in interface org.datanucleus.ConnectionFactoryom - ObjectManager (or null)options - Any options for when creating the connection
public org.datanucleus.ManagedConnection createManagedConnection(org.datanucleus.ObjectManager om,
java.util.Map options)
createManagedConnection in interface org.datanucleus.ConnectionFactoryom - ObjectManageroptions - Transaction options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||