[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1889?page=c...
]
Steve Ebersole commented on HHH-1889:
-------------------------------------
In the future it would be great if the patches were not based on absolute paths, but
rather paths relative to the project structure....
LockMode.UPGRADE not applied in all cases for SQL Server
--------------------------------------------------------
Key: HHH-1889
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1889
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2, 3.2.0.cr3
Environment: Windows XP, Hibernate 3.2.cr3
Reporter: Matthias Germann
Assignee: Steve Ebersole
Fix For: 3.2.2
Attachments: AbstractEntityJoinWalker.java.patch, SQLServerDialect.applyLocks.patch
Passing a LockMode parameter to the get(), load() or refresh() method of the Session
class has no effect on MS SQL Server.
The statement
session.load(ProcessInstance.class, 33l, LockMode.UPGRADE)
produces this SQL Statement with the SQLServerDialect:
select
processins0_.ID_ as ID1_20_0_,
processins0_.VERSION_ as VERSION2_20_0_,
processins0_.START_ as START3_20_0_,
processins0_.END_ as END4_20_0_,
processins0_.ISSUSPENDED_ as ISSUSPEN5_20_0_,
processins0_.PROCESSDEFINITION_ as PROCESSD6_20_0_,
processins0_.ROOTTOKEN_ as ROOTTOKEN7_20_0_,
processins0_.SUPERPROCESSTOKEN_ as SUPERPRO8_20_0_
from
JBPM_PROCESSINSTANCE processins0_
where
processins0_.ID_=?
This Statement does not contain the requested locking hint. The FROM claus should look
like this:
from JBPM_PROCESSINSTANCE processins0_ with (updlock, rowlock)
The OracleDialect produces a correct statement with a FOR UPDATE clause
select
processins0_.ID_ as ID1_20_0_,
processins0_.VERSION_ as VERSION2_20_0_,
processins0_.START_ as START3_20_0_,
processins0_.END_ as END4_20_0_,
processins0_.ISSUSPENDED_ as ISSUSPEN5_20_0_,
processins0_.PROCESSDEFINITION_ as PROCESSD6_20_0_,
processins0_.ROOTTOKEN_ as ROOTTOKEN7_20_0_,
processins0_.SUPERPROCESSTOKEN_ as SUPERPRO8_20_0_
from
JBPM_PROCESSINSTANCE processins0_
where
processins0_.ID_=? for update
The lock() method works correctly.
IMHO, the problem is that only the SimpleSelect class uses the appendLockHint() method of
the Dialect class. The Select class does not seam to use the appendLockHint() method.
--
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