Skip to content

Commit 79913d2

Browse files
committed
HHH-19551 - Address deficiencies in pessimistic locking
1 parent 09d1d89 commit 79913d2

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
db=h2
1+
db=sybase_ci
22

33
# Keep all these properties in sync unless you know what you are doing!
44
# We set '-Dlog4j2.disableJmx=true' to prevent classloader leaks triggered by the logger.

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacySqlAstTranslator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGro
241241
@Override
242242
protected LockStrategy determineLockingStrategy(
243243
QuerySpec querySpec,
244-
Locking.FollowOn followOnLocking) {
244+
Locking.FollowOn followOnStrategy) {
245+
if ( followOnStrategy == Locking.FollowOn.FORCE ) {
246+
return LockStrategy.FOLLOW_ON;
247+
}
245248
// No need for follow on locking
246249
return LockStrategy.CLAUSE;
247250
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacySqlAstTranslator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ private void renderLockHint(LockMode lockMode) {
178178
@Override
179179
protected LockStrategy determineLockingStrategy(
180180
QuerySpec querySpec,
181-
Locking.FollowOn followOnLocking) {
181+
Locking.FollowOn followOnStrategy) {
182+
if ( followOnStrategy == Locking.FollowOn.FORCE ) {
183+
return LockStrategy.FOLLOW_ON;
184+
}
182185
// No need for follow on locking
183186
return LockStrategy.CLAUSE;
184187
}

hibernate-core/src/main/java/org/hibernate/dialect/sql/ast/SybaseASESqlAstTranslator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGro
257257
@Override
258258
protected LockStrategy determineLockingStrategy(
259259
QuerySpec querySpec,
260-
Locking.FollowOn followOnLocking) {
260+
Locking.FollowOn followOnStrategy) {
261+
if ( followOnStrategy == Locking.FollowOn.FORCE ) {
262+
return LockStrategy.FOLLOW_ON;
263+
}
261264
// No need for follow on locking
262265
return LockStrategy.CLAUSE;
263266
}

0 commit comments

Comments
 (0)