Skip to content

Commit 1df861a

Browse files
committed
HHH-19336 - Proper implementation for JPA extended locking scope
HHH-19459 - LockScope, FollowOnLocking # Conflicts: # hibernate-core/src/main/java/org/hibernate/LockOptions.java
1 parent e9a9723 commit 1df861a

File tree

9 files changed

+691
-135
lines changed

9 files changed

+691
-135
lines changed

hibernate-core/src/main/java/org/hibernate/LockMode.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
*
4040
* @see Session#lock(Object, LockMode)
4141
* @see LockModeType
42-
* @see LockOptions
4342
* @see org.hibernate.annotations.OptimisticLocking
4443
*/
4544
public enum LockMode implements FindOption, RefreshOption {
@@ -119,7 +118,10 @@ public enum LockMode implements FindOption, RefreshOption {
119118
* lock mode, if the lock is successfully obtained, are the same
120119
* as {@link #PESSIMISTIC_WRITE}. If the lock is not immediately
121120
* available, an exception occurs.
121+
*
122+
* @deprecated Use {@linkplain Timeouts#NO_WAIT} instead.
122123
*/
124+
@Deprecated
123125
UPGRADE_NOWAIT,
124126

125127
/**
@@ -129,7 +131,10 @@ public enum LockMode implements FindOption, RefreshOption {
129131
* as {@link #PESSIMISTIC_WRITE}. But if the lock is not
130132
* immediately available, no exception occurs, but the locked
131133
* row is not returned from the database.
134+
*
135+
* @deprecated Use {@linkplain Locking.LockedRows#SKIP} instead.
132136
*/
137+
@Deprecated
133138
UPGRADE_SKIPLOCKED,
134139

135140
/**
@@ -143,6 +148,10 @@ public enum LockMode implements FindOption, RefreshOption {
143148
* lock mode is equivalent to {@link #PESSIMISTIC_WRITE}.
144149
*
145150
* @see LockModeType#PESSIMISTIC_READ
151+
* @see jakarta.persistence.Timeout
152+
* @see Locking.Scope
153+
* @see Locking.FollowOn
154+
* @see Locking.LockedRows
146155
*/
147156
PESSIMISTIC_READ,
148157

@@ -152,6 +161,10 @@ public enum LockMode implements FindOption, RefreshOption {
152161
* Obtained via a {@code select for update} statement.
153162
*
154163
* @see LockModeType#PESSIMISTIC_WRITE
164+
* @see jakarta.persistence.Timeout
165+
* @see Locking.Scope
166+
* @see Locking.FollowOn
167+
* @see Locking.LockedRows
155168
*/
156169
PESSIMISTIC_WRITE,
157170

@@ -163,6 +176,10 @@ public enum LockMode implements FindOption, RefreshOption {
163176
* Only legal for versioned entity types.
164177
*
165178
* @see LockModeType#PESSIMISTIC_FORCE_INCREMENT
179+
* @see jakarta.persistence.Timeout
180+
* @see Locking.Scope
181+
* @see Locking.FollowOn
182+
* @see Locking.LockedRows
166183
*/
167184
PESSIMISTIC_FORCE_INCREMENT;
168185

0 commit comments

Comments
 (0)