| Craig Russell (JIRA) 2006-12-21, 7:11 pm |
| [ http://issues.apache.org/jira/brows...action_12460364 ]
Craig Russell commented on JDO-445:
-----------------------------------
Here's a working draft of the specification text in Chapter 11.
PersistenceManager getPersistenceManagerProxy();
Returns a PersistenceManager instance that is thread-safe in web and application servers, that dynamically delegates to the PersistenceManager currently associated with the thread's transaction. The instance returned can be used in a servlet init method t
o initialize a static variable in a web server application. Similarly, it can be used in a session bean to initialize a static variable in an application server application.
If any method is invoked on the returned instance, the instance dynamically binds to a delegate PersistenceManager obtained from the PersistenceManagerFactory from which the proxy was obtained.
If there is an active global transaction bound to the calling thread, and there is a PersistenceManager currently bound to the transaction, the method is invoked on the delegate.
If there is an active global transaction bound to the calling thread, and there is not a PersistenceManager currently bound to the transaction, a PersistenceManager is obtained from the PersistenceManagerFactory (which automatically associates the Persist
enceManager with the transaction) and the method is invoked on the delegate.
Committing or rolling back a global transaction has the side effect of disassociating the PersistenceManager from the transaction during afterCompletion.
Open questions:
What should the behavior be if there is no global transaction active?
Outside the server environment, what should the Proxy do?
> Add convenience method that returns a PersistenceManager proxy
> --------------------------------------------------------------
>
> Key: JDO-445
> URL: http://issues.apache.org/jira/browse/JDO-445
> Project: JDO
> Issue Type: New Feature
> Components: api2, api2-legacy
> Reporter: Michelle Caisse
> Assigned To: Craig Russell
> Fix For: JDO 2 maintenance release 1
>
> Attachments: PMProxy-patch.txt
>
>
> In Chapter 8, add a convenience method that returns a PersistenceManager proxy that can be used in web and ejb containers to dynamically bind to the transaction-associated PersistenceManager.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|