db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-445) Add convenience method that returns a PersistenceManager proxy
Date Thu, 21 Dec 2006 23:16:22 GMT
    [ http://issues.apache.org/jira/browse/JDO-445?page=comments#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 to 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 PersistenceManager 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/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message