Hi Craig,
please see my comments below.
Craig L Russell schrieb:
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.
Doesn't that again mean
"JDOHelper.getPersistenceManager(pm.getObjectById (pc)) != pm", which,
according to Abe White, is a broken system?
Possibly that discussion already existed and I'm saying something
stupid, but what about a new open() method and all operations throwing
exception after close(), except for open()? I'd also find that more in
line with accustomed operations on poolable objects anyway.
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:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!