Description:
|
Assume the following:
Two entity types:
RelationOne
@ManyToOne
@NotFound(IGNORE)
RelationTwo relationTwo;
RelationTwo
(nothing special)
Further:
insert one instance of RelationTwo
insert two instances of RelationOne, which reference RelationTwo
Next step:
commit
Next:
new Session & TX
Load RelationOne (Session.get())
Delete RelationOne (Session.delete())
commit
Next:
new Session & TX
Load one instance of RelationTwo (everything is fine)
Load next instance of RelationTwo (FAILURE)
org.hibernate.event.internal.DefaultLoadEventListener#proxyOrLoad contains the following code:
The load of the first instance of RelationTwo has a null proxy variable for RelationOne, but the second load of RelationTwo has a non-null proxy variable for RelationOne. This results in a call to org.hibernate.event.internal.DefaultLoadEventListener#load which unconditionally raises an ObjectNotFound exception.
|