db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Issue 158: Specification clarification 11.3
Date Fri, 10 Feb 2006 21:37:13 GMT
Javadogs,

While reviewing the spec in some more detail prior to closing it for  
the release, I noticed that there is a corollary to the requirement that

"after close(), all methods that actually do anything must throw  
exceptions. "

So if a PM is closed and put back into the pool, it can never be  
given out again because it needs to be opened. This violates the  
requirement that after close, all methods throw exceptions.

The problem can be avoided by using proxies (that are permanently  
closed by close()) and giving the proxies to the user. The proxies  
can be garbage collected and the proxied PersistenceManager can be  
put back into the pool when the proxy is closed.

Take a look at this proposed clarification that describes  
PersistenceManagerFactory.getPersistenceManager.

<proposed>
This method will never return the same instance as was returned bya  
previous invocation of the method. Note that this implies that pooled  
implementations must use proxies and not return the pooled instance  
directly from the pool.
</proposed>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message