Skip to content

Commit 321fd2e

Browse files
committed
HHH-19336 - Proper implementation for JPA extended locking scope
HHH-19459 - LockScope, FollowOnLocking HHH-19501 - Session#lock w/ pessimistic locks for scopes HHH-19502 - Disallow SKIP_LOCKED with Session#lock HHH-19503 - Track a Dialect's level of support for locking joined tables
1 parent 82835da commit 321fd2e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,18 +2541,25 @@ public String getReadLockString(String aliases, int timeout) {
25412541
return getReadLockString( timeout );
25422542
}
25432543

2544+
/**
2545+
* Reports the Dialect's level of support for outer joins with pessimistic locking.
2546+
*/
2547+
public OuterJoinLockingLevel getOuterJoinLockingLevel() {
2548+
return OuterJoinLockingLevel.FULL;
2549+
}
2550+
25442551
/**
25452552
* Does this dialect support {@code FOR UPDATE} in conjunction with
25462553
* outer-joined rows?
25472554
*
25482555
* @return True if outer-joined rows can be locked via {@code FOR UPDATE}.
2556+
*
2557+
* @deprecated Use {@linkplain #getOuterJoinLockingLevel()} instead.
25492558
*/
2559+
@Deprecated
25502560
public boolean supportsOuterJoinForUpdate() {
2551-
return getOuterJoinLockingLevel() == OuterJoinLockingLevel.FULL;
2552-
}
2553-
2554-
public OuterJoinLockingLevel getOuterJoinLockingLevel() {
2555-
return OuterJoinLockingLevel.FULL;
2561+
return getOuterJoinLockingLevel() == OuterJoinLockingLevel.FULL
2562+
|| getOuterJoinLockingLevel() == OuterJoinLockingLevel.IDENTIFIED;
25562563
}
25572564

25582565
/**

hibernate-core/src/main/java/org/hibernate/dialect/lock/spi/OuterJoinLockingLevel.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ public enum OuterJoinLockingLevel {
3737
ROOT_ONLY,
3838

3939
/**
40-
* Applying locks to joins is fully supported, acquiring locks
41-
* on all tables.
40+
* Applying locks to joined rows is supported, acquiring locks on all tables.
4241
*/
4342
FULL,
4443

4544
/**
46-
* The joined rows to lock can be controlled per table reference,
47-
* generally via one of:<ul>
45+
* Applying locks to joined rows is supported. Which table rows are locked can be controlled
46+
* per table reference, generally via one of:<ul>
4847
* <li>{@linkplain org.hibernate.dialect.RowLockStrategy#TABLE}
4948
* <li>{@linkplain org.hibernate.dialect.RowLockStrategy#COLUMN}
5049
* <li>{@linkplain org.hibernate.dialect.lock.PessimisticLockStyle#TABLE_HINT}

0 commit comments

Comments
 (0)