[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1645?page=c...
]
Laura Dean updated HHH-1645:
----------------------------
Attachment: ProxyTest.java
I've attached a version of ProxyTest.java with 4 new methods to illustrate the issue.
It's based on Branch_3_2 in subversion.
testRefreshLockInitializedProxy(): shows that the LockMode is correct for an initialized
proxy.
testRefreshLockUninitializedProxy(): shows that it doesn't work for an un-initialized
proxy.
testRefreshLockUninitializedProxyThenRead(): shows that even after you read a field, the
LockMode is not UPGRADE.
testtLockUninitializedProxy(): shows that the Session.lock method does work as expected.
The first two methods illustrate the problem; the other two just elaborate.
refresh with LockMode on an unitialized proxy does not work
-----------------------------------------------------------
Key: HHH-1645
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1645
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.1.3
Reporter: Michael Kopp
Attachments: ProxyTest.java
the DefaultRefreshEventListener.onRefresh method checks if the object in question is an
UninitializedProxy.
if ( source.getPersistenceContext().reassociateIfUninitializedProxy( event.getObject() )
) return;
If this is the case it will reassociate it and return.
The problem is it will lose the LockMode. If the refresh call was actually done with
LockMode.upgrade, the result should be a select for update, which does not happen in this
case.
This is especially anoying as it depends on the state of the proxy:
- unitialized --> no for update
- initialzed --> select for update
--
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