[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3069?page=c...
]
dan oxlade commented on HHH-3069:
---------------------------------
That is not the issue.
The ids are unique, if you look at the failing test case the id is 0, this could just as
well be any id that doesn't exist in either person or employee tables.
The point that session.get() should return consistently, calling session.get before the
proxy is in the session works just fine but after a proxy is loaded into the session it
falls over.
The test case is explicit but assume that person has been loaded (as proxy) because of
another entity being loaded then you are in all sorts of trouble.
This should be reopend
ObjectNotFoundException when proxy exists for super class of non
existant joined subclass
-----------------------------------------------------------------------------------------
Key: HHH-3069
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3069
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Reporter: dan oxlade
A proxy of an entity which has a joined subclass is loaded into the session.
If the proxy resolves to null, i.e the id of the proxy has no matching row in the
database then future queries (in the same hibernate session) for any of the joined
subclass entities will fail with ObjectNotFoundExceptions from the returnNarrowedProxy
method of the DefaultLoadEventListener.
the following test method in JoinedSubclassTest demonstrates the failing test:
public void testProxyLoadedWhichDoesNotExist() throws Exception {
Session s = openSession();
Transaction t = s.beginTransaction();
Long id = Long.valueOf(0L);
Employee employee = (Employee) s.get(Employee.class,id);
assertNull(employee);
Person proxy = (Person) s.load(Person.class,id);
assertNotNull(proxy);
employee = (Employee) s.get(Employee.class,id);
assertNull(employee);
t.commit();
s.close();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira