Oracle Application Server TopLink API Reference
10g (9.0.4)

B10491-01

oracle.toplink.jdo
Class JDOPersistenceManagerFactory

java.lang.Object
  |
  +--oracle.toplink.jdo.JDOPersistenceManagerFactory
All Implemented Interfaces:
javax.jdo.PersistenceManagerFactory, java.io.Serializable

public class JDOPersistenceManagerFactory
extends java.lang.Object
implements javax.jdo.PersistenceManagerFactory

PUBLIC: TopLink persistence manager for the JDO specification. This supports JDO through the TopLink API, Supported are the basic JDO interfaces but not required or implemented are the PersistenceCapable implementation, byte-code enhancers or any other internal JDO reference implementation related aspects. JDO wrapper for a TopLink session manager.

The factory allows for a persistence manager to be acquire through two methods,

- a TopLink Project is provided to the factory and a persistence manager on a DatabaseSession is returned (this should only be used in two-tier)

- a session-name is provided to the factory (or default name is used) and the TopLink SessionManager is used to access a defined ServerSession from the TopLink Session.xml file.

See Also:
Serialized Form

Constructor Summary
JDOPersistenceManagerFactory()
          Create a new factory, by default this will connect through the TopLink SessionManager to the default session.
JDOPersistenceManagerFactory(Project project)
          Create a new factory that will use the project to create the persistence manager's TopLink session instance.
JDOPersistenceManagerFactory(Session topLinkSession)
          Create a new factory that will use TopLink session instance.
JDOPersistenceManagerFactory(java.lang.String sessionName)
          Create a new factory that will use the session-name to lookup the persistence manager's TopLink session through the TopLink SessionManager.

 

Method Summary
 java.lang.String getConnectionDriverName()
          Get the driver name for the data store connection.
 java.lang.Object getConnectionFactory()
          Get the data store connection factory.
 java.lang.Object getConnectionFactory2()
          PUBLIC: This method is not supported and it always returns null
 java.lang.String getConnectionFactory2Name()
          PUBLIC: This method is not supported and it always returns null Get the name for the second data store connection factory.
 java.lang.String getConnectionFactoryName()
          Get the name for the data store connection factory.
 java.lang.String getConnectionURL()
          Get the URL for the data store connection.
 java.lang.String getConnectionUserName()
          Get the user name for the data store connection.
 boolean getIgnoreCache()
          Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 int getMaxPool()
          PUBLIC: This method is not supported and it always returns 0 Get the MaxPool setting for the PersistenceManager pool for this factory.
 int getMinPool()
          PUBLIC: This method is not supported and it always returns 0 Get the MinPool setting for the PersistenceManager pool for this factory.
 int getMsWait()
          PUBLIC: This method is not supported and it always returns 0 Get the MsWait setting for the PersistenceManager pool for this factory.
 boolean getMultithreaded()
          PUBLIC: Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 boolean getNontransactionalRead()
          When the nontransactional read flag is set to false the PersistenceManager has a single TopLink UnitOfWork associated with it.
 boolean getNontransactionalWrite()
          Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 boolean getOptimistic()
          Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 javax.jdo.PersistenceManager getPersistenceManager()
          Get an instance of PersistenceManager from this factory.
 javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userid, java.lang.String password)
          Get an instance of PersistenceManager from this factory.
 Project getProject()
          Return the associated TopLink project if defined.
 java.util.Properties getProperties()
          getProperties method comment.
 boolean getRetainValues()
          Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 java.lang.String getSessionName()
          Return the session-name used to lookup the factories ServerSession through the TopLink SessionManager.
 void setConnectionDriverName(java.lang.String driverName)
          PUBLIC: Set the driver name for the data store connection.
 void setConnectionFactory(java.lang.Object connectionFactory)
          Set the data store connection factory.
 void setConnectionFactory2(java.lang.Object connectionFactory)
          Set the second data store connection factory.
 void setConnectionFactory2Name(java.lang.String connectionFactoryName)
          Set the name for the second data store connection factory.
 void setConnectionFactoryName(java.lang.String connectionFactoryName)
          Set the name for the data store connection factory.
 void setConnectionPassword(java.lang.String password)
          Set the password for the data store connection.
 void setConnectionURL(java.lang.String URL)
          Set the URL for the data store connection.
 void setConnectionUserName(java.lang.String userName)
          Set the user name for the data store connection.
 void setIgnoreCache(boolean ignoreCache)
          Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 void setMaxPool(int maxPool)
          Set the MaxPool setting for the PersistenceManager pool for this factory.
 void setMinPool(int minPool)
          Set the MinPool setting for the PersistenceManager pool for this factory.
 void setMsWait(int msWait)
          Set the MsWait setting for the PersistenceManager pool for this factory.
 void setMultithreaded(boolean multithreaded)
          PUBLIC: JDO: Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 void setNontransactionalRead(boolean nontransactionalRead)
          PUBLIC: When the nontransactional read flag is set to false the PersistenceManager has a single TopLink UnitOfWork associated with it.
 void setNontransactionalWrite(boolean flag)
          PUBLIC: This method is not supported Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 void setOptimistic(boolean flag)
          PUBLIC: This method is not supported Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 void setRetainValues(boolean flag)
          PUBLIC: This method is not supported
 java.util.Collection supportedOptions()
          The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

JDOPersistenceManagerFactory

public JDOPersistenceManagerFactory()
Create a new factory, by default this will connect through the TopLink SessionManager to the default session.

JDOPersistenceManagerFactory

public JDOPersistenceManagerFactory(java.lang.String sessionName)
Create a new factory that will use the session-name to lookup the persistence manager's TopLink session through the TopLink SessionManager.

JDOPersistenceManagerFactory

public JDOPersistenceManagerFactory(Project project)
Create a new factory that will use the project to create the persistence manager's TopLink session instance. A DatabaseSession will be created and this mechanism should only be used for 2-tier applications.

JDOPersistenceManagerFactory

public JDOPersistenceManagerFactory(Session topLinkSession)
Create a new factory that will use TopLink session instance. The session can be a DatabseSession or a ServerSession
Method Detail

getConnectionDriverName

public java.lang.String getConnectionDriverName()
Get the driver name for the data store connection.
Specified by:
getConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Returns:
the driver name for the data store connection.

getConnectionFactory

public java.lang.Object getConnectionFactory()
Get the data store connection factory.
Specified by:
getConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Returns:
the data store connection factory.

getConnectionFactoryName

public java.lang.String getConnectionFactoryName()
Get the name for the data store connection factory.
Specified by:
getConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Returns:
the name of the data store connection factory.

getConnectionURL

public java.lang.String getConnectionURL()
Get the URL for the data store connection.
Specified by:
getConnectionURL in interface javax.jdo.PersistenceManagerFactory
Returns:
the URL for the data store connection.

getConnectionUserName

public java.lang.String getConnectionUserName()
Get the user name for the data store connection.
Specified by:
getConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Returns:
the user name for the data store connection.

getIgnoreCache

public boolean getIgnoreCache()
Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
Specified by:
getIgnoreCache in interface javax.jdo.PersistenceManagerFactory
Returns:
the default IngoreCache setting.

getNontransactionalRead

public boolean getNontransactionalRead()
When the nontransactional read flag is set to false the PersistenceManager has a single TopLink UnitOfWork associated with it. All objects are accessed in the context of this unit of work to preserve clone identity. When the nontransactional read flag is set to true, the PersistenceManager only acquires a unit of work on the begin of the transaction and objects that are to be changed must be first reigstered into the transaction context through re-querying them, or through the getObjectById This enables read to occur on the shared object cache, without the overhead of cloning and change tracking, it also allows for nested units of work to be supported.

JDO: Get the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
getNontransactionalRead in interface javax.jdo.PersistenceManagerFactory
Returns:
the default NontransactionalRead setting.

getNontransactionalWrite

public boolean getNontransactionalWrite()
Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
Specified by:
getNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Returns:
the default NontransactionalWrite setting.

getOptimistic

public boolean getOptimistic()
Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.
Specified by:
getOptimistic in interface javax.jdo.PersistenceManagerFactory
Returns:
the default Optimistic setting.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Get an instance of PersistenceManager from this factory. The instance has default values for options.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Returns:
a PersistenceManager instance with default options.

getRetainValues

public boolean getRetainValues()
Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.
Specified by:
getRetainValues in interface javax.jdo.PersistenceManagerFactory
Returns:
the default RetainValues setting.

setConnectionDriverName

public void setConnectionDriverName(java.lang.String driverName)
PUBLIC: Set the driver name for the data store connection. This method is only in effect when the factory is instantiate with a project JDOPersistenceManagerFactory(Project)
Specified by:
setConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Parameters:
driverName - the driver name for the data store connection.

setConnectionFactory

public void setConnectionFactory(java.lang.Object connectionFactory)
Set the data store connection factory. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.
Specified by:
setConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactory - the data store connection factory.

setConnectionFactoryName

public void setConnectionFactoryName(java.lang.String connectionFactoryName)
Set the name for the data store connection factory.
Specified by:
setConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactoryName - the name of the data store connection factory.

setConnectionPassword

public void setConnectionPassword(java.lang.String password)
Set the password for the data store connection.
Specified by:
setConnectionPassword in interface javax.jdo.PersistenceManagerFactory
Parameters:
password - the password for the data store connection.

setConnectionURL

public void setConnectionURL(java.lang.String URL)
Set the URL for the data store connection.
Specified by:
setConnectionURL in interface javax.jdo.PersistenceManagerFactory
Parameters:
URL - the URL for the data store connection.

setConnectionUserName

public void setConnectionUserName(java.lang.String userName)
Set the user name for the data store connection.
Specified by:
setConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Parameters:
userName - the user name for the data store connection.

setIgnoreCache

public void setIgnoreCache(boolean ignoreCache)
Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
Specified by:
setIgnoreCache in interface javax.jdo.PersistenceManagerFactory

setNontransactionalRead

public void setNontransactionalRead(boolean nontransactionalRead)
PUBLIC: When the nontransactional read flag is set to false the PersistenceManager has a single TopLink UnitOfWork associated with it. All objects are accessed in the context of this unit of work to preserve clone identity. When the nontransactional read flag is set to true, the PersistenceManager only acquires a unit of work on the begin of the transaction and objects that are to be changed must be first reigstered into the transaction context through re-querying them, or through the getObjectById This enables read to occur on the shared object cache, without the overhead of cloning and change tracking, it also allows for nested units of work to be supported.

JDO: Set the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalRead in interface javax.jdo.PersistenceManagerFactory

setNontransactionalWrite

public void setNontransactionalWrite(boolean flag)
PUBLIC: This method is not supported

Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default NontransactionalWrite setting.

setOptimistic

public void setOptimistic(boolean flag)
PUBLIC: This method is not supported

Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.

Specified by:
setOptimistic in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default Optimistic setting.

setRetainValues

public void setRetainValues(boolean flag)
PUBLIC: This method is not supported
Specified by:
setRetainValues in interface javax.jdo.PersistenceManagerFactory

getConnectionFactory2

public java.lang.Object getConnectionFactory2()
PUBLIC: This method is not supported and it always returns null
Specified by:
getConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory

getConnectionFactory2Name

public java.lang.String getConnectionFactory2Name()
PUBLIC: This method is not supported and it always returns null Get the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.
Specified by:
getConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory
Returns:
the name of the data store connection factory.

getMaxPool

public int getMaxPool()
PUBLIC: This method is not supported and it always returns 0 Get the MaxPool setting for the PersistenceManager pool for this factory.
Specified by:
getMaxPool in interface javax.jdo.PersistenceManagerFactory
Returns:
the MaxPool setting.

getMinPool

public int getMinPool()
PUBLIC: This method is not supported and it always returns 0 Get the MinPool setting for the PersistenceManager pool for this factory.
Specified by:
getMinPool in interface javax.jdo.PersistenceManagerFactory
Returns:
the MinPool setting.

getMsWait

public int getMsWait()
PUBLIC: This method is not supported and it always returns 0 Get the MsWait setting for the PersistenceManager pool for this factory.
Specified by:
getMsWait in interface javax.jdo.PersistenceManagerFactory
Returns:
the MsWait setting.

getMultithreaded

public boolean getMultithreaded()
PUBLIC: Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory. Eventhough it is possible to use
Specified by:
getMultithreaded in interface javax.jdo.PersistenceManagerFactory
Returns:
the default Multithreaded setting.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userid,
                                                          java.lang.String password)
Get an instance of PersistenceManager from this factory. The instance has default values for options. The parameters userid and password are used when obtaining datastore connections from the connection pool.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Parameters:
userid - the userid for the connection
password - the password for the connection
Returns:
a PersistenceManager instance with default options.

getProject

public Project getProject()
Return the associated TopLink project if defined.

getProperties

public java.util.Properties getProperties()
getProperties method comment.
Specified by:
getProperties in interface javax.jdo.PersistenceManagerFactory

getSessionName

public java.lang.String getSessionName()
Return the session-name used to lookup the factories ServerSession through the TopLink SessionManager.

setConnectionFactory2

public void setConnectionFactory2(java.lang.Object connectionFactory)
Set the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.
Specified by:
setConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactory - the data store connection factory.

setConnectionFactory2Name

public void setConnectionFactory2Name(java.lang.String connectionFactoryName)
Set the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.
Specified by:
setConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactoryName - the name of the data store connection factory.

setMaxPool

public void setMaxPool(int maxPool)
Set the MaxPool setting for the PersistenceManager pool for this factory.
Specified by:
setMaxPool in interface javax.jdo.PersistenceManagerFactory
Parameters:
maxPool - the MaxPool setting.

setMinPool

public void setMinPool(int minPool)
Set the MinPool setting for the PersistenceManager pool for this factory.
Specified by:
setMinPool in interface javax.jdo.PersistenceManagerFactory
Parameters:
minPool - the MinPool setting.

setMsWait

public void setMsWait(int msWait)
Set the MsWait setting for the PersistenceManager pool for this factory.
Specified by:
setMsWait in interface javax.jdo.PersistenceManagerFactory
Parameters:
msWait - the MsWait setting.

setMultithreaded

public void setMultithreaded(boolean multithreaded)
PUBLIC:

JDO: Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.

Specified by:
setMultithreaded in interface javax.jdo.PersistenceManagerFactory

supportedOptions

public java.util.Collection supportedOptions()
The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.

Each supported JDO optional feature is represented by a String with one of the following values:

javax.jdo.option.TransientTransactional

javax.jdo.option.NontransactionalRead

javax.jdo.option.NontransactionalWrite

javax.jdo.option.RetainValues

javax.jdo.option.Optimistic

javax.jdo.option.ApplicationIdentity

javax.jdo.option.DatastoreIdentity

javax.jdo.option.NonDatastoreIdentity

javax.jdo.option.ArrayList

javax.jdo.option.HashMap

javax.jdo.option.Hashtable

javax.jdo.option.LinkedList

javax.jdo.option.TreeMap

javax.jdo.option.TreeSet

javax.jdo.option.Vector

javax.jdo.option.Map

javax.jdo.option.List

javax.jdo.option.Array

javax.jdo.option.NullCollection

The standard JDO query language is represented by a String:

javax.jdo.query.JDOQL

Specified by:
supportedOptions in interface javax.jdo.PersistenceManagerFactory
Returns:
the List of String representing the supported Options

Copyright © 2003 Oracle Corporation. All Rights Reserved.