org.datanucleus
Class ConnectionManagerImpl

java.lang.Object
  extended by org.datanucleus.ConnectionManagerImpl
All Implemented Interfaces:
ConnectionManager

public class ConnectionManagerImpl
extends java.lang.Object
implements ConnectionManager

Manager of connections for an OMF, allowing ManagedConnection pooling, enlistment in transaction. The pool caches one connection per ObjectManager. The "allocate" method can create connections and enlist them (like most normal persistence operations need) or create a connection and return it.

Version:
$Revision: 1.17 $

Field Summary
protected static Localiser LOCALISER
          Localisation of messages.
 
Constructor Summary
ConnectionManagerImpl(OMFContext omfContext)
          Constructor.
 
Method Summary
 ManagedConnection allocateConnection(ConnectionFactory factory, ObjectManager om, java.util.Map options)
          Method to return a connection for this ObjectManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localisation of messages.

Constructor Detail

ConnectionManagerImpl

public ConnectionManagerImpl(OMFContext omfContext)
Constructor.

Parameters:
omfContext - OMFContext for this manager.
Method Detail

allocateConnection

public ManagedConnection allocateConnection(ConnectionFactory factory,
                                            ObjectManager om,
                                            java.util.Map options)
Method to return a connection for this ObjectManager. If a connection for the ObjectManager exists in the cache will return it. If no connection exists will create a new one using the ConnectionFactory.

Specified by:
allocateConnection in interface ConnectionManager
Parameters:
factory - ConnectionFactory it relates to
om - The ObjectManager
options - Options for the connection (e.g isolation). These will override those of the txn itself
Returns:
The ManagedConnection


Copyright © 2009. All Rights Reserved.