Skip to content

Commit 35206e2

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
1 parent 5f70e40 commit 35206e2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/lock/internal/SqlAstBasedLockingStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public void lock(
6161
int timeout,
6262
SharedSessionContractImplementor session) throws StaleObjectStateException, LockingStrategyException {
6363
if ( session instanceof EventSource eventSource ) {
64-
doLock( id, version, object, timeout, eventSource );
64+
doLock( id, version, timeout, eventSource );
6565
}
6666
else {
6767
throw new UnsupportedOperationException( "Optimistic locking strategies not supported in stateless session" );
6868
}
6969
}
7070

71-
private void doLock(Object id, Object version, Object object, int timeout, EventSource eventSource) {
71+
private void doLock(Object id, Object version, int timeout, EventSource eventSource) {
7272
final SessionFactoryImplementor factory = eventSource.getFactory();
7373

7474
final LockOptions lockOptions = new LockOptions( lockMode );

hibernate-core/src/main/java/org/hibernate/event/spi/LockEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public LockEvent(String entityName, Object object, LockMode lockMode, EventSourc
2929

3030
public LockEvent(String entityName, Object object, LockOptions lockOptions, EventSource source) {
3131
super(source);
32+
this.entityName = entityName;
3233
this.object = object;
3334
this.lockOptions = lockOptions;
3435
if ( lockOptions.getLockMode() == LockMode.UPGRADE_SKIPLOCKED

0 commit comments

Comments
 (0)