[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5750?page=c...
]
Erik-Berndt Scheper commented on HHH-5750:
------------------------------------------
I have verified that removing
bq.{{proxy.getHibernateLazyInitializer().setImplementation( target );}}
from org.hibernate.envers.tools.Tools does fix the issue reported, and that all tests in
the Envers test suite still pass.
This code was originally introduced by HHH-3871 (Unnecessary proxy initialization on audit
record save), and later modified by HHH-4791 (Invalid assumption made in
org.hibernate.envers.tools.Tools#getTargetFromProxy).
The test case also passes with the existing code by changing
bq.{{Person pers1 = (Person) getSession().load(Person.class, id_pers1);}}
into
bq.{{Person pers1 = (Person) getSession().get(Person.class, id_pers1);}}
So this could be used as a work around.
Envers unset session on proxy
-----------------------------
Key: HHH-5750
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5750
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.6.0
Reporter: Sven Rienstra
Assignee: Erik-Berndt Scheper
Attachments: HHH5750ImprovedTestcase.zip, ToolsTest.java
A bug in envers Tools causes proxy objects to lose their session after post-insert
actions have been performed. The function Tools.getTargetFromProxy loads an instance of
the proxytarget with a temporary session, puts the instance into the proxy and finally
closes the session. After this all the persistentbags in the instance have lost their
session because it is closed. The attached testcase demonstrates this behavior.
I'm not sure how this should be fixed, but i guess the proxy should be reattached to
the old session after envers is done with it.
--
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