132 words

getPersistenceManagerProxy() - JDO PersistenceManagerFactory's method

Get a thread-safe instance of a proxy that dynamically binds on each method call to an instance of PersistenceManager.

When used with a PersistenceManagerFactory that uses TransactionType JTA, the proxy can be used in a server to dynamically bind to an instance from this factory associated with the thread's current transaction. In this case, the close method is ignored, as the PersistenceManager is automatically closed when the transaction completes.

When used with a PersistenceManagerFactory that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable ThreadLocal to bind to an instance of PersistenceManager associated with the thread. In this case, the close method executed on the proxy closes the PersistenceManager and then clears the ThreadLocal. Use of this method does not affect the configurability of the PersistenceManagerFactory.

Returns:
a PersistenceManager proxy.
Since:
JDO 2.1

This documentation page is derived (with some adjustments) from the JDO 2.2 API
and is available under the terms of the Apache License, v. 2.0.