|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.connection.AbstractConnectionFactory
org.datanucleus.store.db4o.ConnectionFactoryImpl
public class ConnectionFactoryImpl
Implementation of a ConnectionFactory for DB4O. Obtains access to the DB4O ObjectContainer supporting use of
When an ObjectContainer is obtained for an ObjectManager, it is cached so all subsequent uses for that ObjectManager will have the same ObjectContainer. This means that the ObjectContainer is aligned with the transaction, and so we can use commit/rollback on the ObjectContainer. When the txn commits we still have the ObjectContainer in the cache so if a subsequent txn starts on the same ObjectManager it will then have the same ObjectContainer. When the ObjectManager is closed the ObjectContainer is finally closed.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER_DB4O
Localiser for messages. |
protected java.util.Map |
objectContainerByObjectManager
Cache of the DB4O ObjectContainer keyed by ObjectManager. |
| Fields inherited from class org.datanucleus.store.connection.AbstractConnectionFactory |
|---|
omfContext, options |
| Fields inherited from interface org.datanucleus.store.connection.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 |
closeObjectContainerForObjectManager(java.lang.Object poolKey)
Convenience method to notify the factory that the specified ObjectManager is closing, so to close any resources for it. |
org.datanucleus.store.connection.ManagedConnection |
createManagedConnection(java.lang.Object poolKey,
java.util.Map options)
Obtain a connection from the Factory. |
protected com.db4o.config.Configuration |
getNewConfiguration()
|
protected com.db4o.ObjectContainer |
getNewObjectContainer()
Convenience method to create a new ObjectContainer for this datastore. |
| Methods inherited from class org.datanucleus.store.connection.AbstractConnectionFactory |
|---|
getConnection |
| 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_DB4O
protected java.util.Map objectContainerByObjectManager
| 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 closeObjectContainerForObjectManager(java.lang.Object poolKey)
om - ObjectManagerprotected com.db4o.config.Configuration getNewConfiguration()
protected com.db4o.ObjectContainer getNewObjectContainer()
public org.datanucleus.store.connection.ManagedConnection createManagedConnection(java.lang.Object poolKey,
java.util.Map options)
Transaction
associated to the poolKey if "enlist" is set to true.
poolKey - the pool that is bound the connection during its lifecycle (or null)options - Any options for then creating the connection
ManagedConnection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||