db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <Craig.Russ...@Sun.COM>
Subject Re: jdoPreClear on deleted instances
Date Sun, 17 Jul 2005 21:31:43 GMT
Hi Erik,

On Jul 17, 2005, at 2:15 AM, erik@jpox.org wrote:

> TCK: org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear -  
> JIRA #70
> During commit jdoPreClear is called in p-deleted instances.  
> jdoPreClear is not
> enhanced, and access to persistent fields is not allowed on p-deleted
> instances, but the TCK does. Should jdoPreClear be called on p-deleted
> instances?

Yes. The idea is that jdoPreClear cannot affect the persistent state  
of instances because it's called during afterCompletion. And the  
method is not enhanced so no one will ever know. The job of  
jdoPreClear is to do any cleanup of the instance that might be needed  
before it transitions to transient.

Access to persistent fields (except for identity fields which can  
always be accessed) of deleted instances is detected by enhanced code  
that ends up calling the StateManager. While in jdoPreDelete, nothing  
that the method does is mediated, which is why it cannot call other  
methods that are enhanced!


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!

View raw message