7.3. Obtaining PersistenceManagers

public PersistenceManager getPersistenceManager ();
public PersistenceManager getPersistenceManager (String user, String pass);

The PersistenceManagerFactory interface includes two getPersistenceManager methods for obtaining PersistenceManager instances. One version takes as parameters the user name and password to use for the PersistenceManager's data store connection. The other version relies on the ConnectionUserName and ConnectionPassword settings of the PersistenceManagerFactory. Both methods may return a newly-constructed PersistenceManager, or may return one from a pool of instances.

If the PersistenceManagerFactory was not already immutable, then it will be after you acquire the first PersistenceManager from it. Any attempt to change the factory's properties will result in a JDOUserException.

 

Skip navigation bar   Back to Top