Problem locking an proxy to session when an detached proxy is already on its persistence
context
------------------------------------------------------------------------------------------------
Key: HHH-5871
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5871
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.0
Environment: web app over tomcat using hibernate version 3.5.6-Final and
spring.version 3.0.5.RELEASE with SpringWebApplicationFactory configured as an filter on
web.xml
Reporter: pedro santos
Attachments: stackTrace.txt, test-fix.patch
Problem locking an proxy to session when an detached proxy is already on its persistence
context
The call: session.lock(proxy, LockMode.NONE) is throwing:
org.hibernate.TransientObjectException: Proxy is detached (i.e, session is null). The
read-only/modifiable setting is only accessible when the proxy is associated with an open
session.
The problem is that I'm not able to lock an proxy on session due an old detached proxy
already add on its persistence context. I'm sending an test case demonstrating the
bug, plus the fix on TwoPhaseLoad to don't test lazyInitializer ready only property
when it is not available.
What is weird on all this problem is: how did an detached proxy get in another opened
session? I'm simulating it on the test case, but my application code don't even
look like it. I created the test case only by analyzing the exception stack trace. This
problem is happening time to time and crash the production app.
--
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