[ 
http://issues.apache.org/jira/browse/JDO-445?page=comments#action_12460509 ] 
            
Michael Watzek commented on JDO-445:
------------------------------------

Hi Craig,

the patch looks good! Please find my comments below:

- PersistenceManagerProxies are cached using PMF instances as keys. Thus, you 
get the same proxy for the same PMF. I think this pattern disallows 
applications to implementing a 1:1 mapping for servlets and PMFs because 
applications would retrieve the same proxy instance with each (possibly 
concurrent) request.

- PersistenceManagerProxy.close() does nothing. This means that after calling 
close, it's still possible to successfully call methods like makePersistent() 
etc. My understanding of javax.jdo.PersistenceManager is that all methods throw 
exceptions after close() except for isClosed(). Is it a goal to have the same 
behavior for the proxy class and javax.jdo.PersistenceManager?

- Why is getPersistenceManagerProxy() a static method on class 
PersistenceManagerProxy rather than on class JDOHelper? This means that 
application code must import class PersistenceManagerProxy. If the method is 
defined on JDOHelper then class PersistenceManagerProxy can have default access 
modifier and the proxy class can be transparent to application code.

- Class PersistenceManagerProxy never calls remove on static field 
'persistenceManagerProxies'.

- The JNDI lookup of TransactionSynchronizationRegistry is done in a static 
initializer which may throw ExceptionInInitializerError. Would it make sense to 
do the lookup in getPersistenceManagerProxy()?

Regards,
Michael


> 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

        

Reply via email to