I'd appreciate any ideas on this...
If I delete an object as follows:
session.delete( facility );
session.flush(); //not sure if this is necessary?
tx.commit();
then later attempt to load this object using:
session.load( Facility.class, facilityID );
The deleted object is found and loaded, instead of throwing a ObjectNotFoundException.
Note that this only happens if I specify a proxy for the Facility class. It fails properly with no proxy.
Also note that a session.find( 'from Facility f where f.facilityID = ?" ...) properly returns an empty set for that facility ID with or without a proxy.
I tried to evict() the object from the cache before delete()ing it, but this did not make a difference.
Is this a known bug or am I missing a step? Any ideas?
Thanks!
Michael.
|