HHH-18023 fix wrong test assertions
OPTIMISTIC means the version gets checked at end of tx, this lock mode is never acquired implicitly Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
1657702015
commit
1e0e0ac02b
|
@ -79,7 +79,7 @@ public class BatchAndLockTest {
|
||||||
scope.inTransaction(
|
scope.inTransaction(
|
||||||
session -> {
|
session -> {
|
||||||
TestEntity testEntity = session.find( TestEntity.class, 1 );
|
TestEntity testEntity = session.find( TestEntity.class, 1 );
|
||||||
assertEntityLockMode( testEntity, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( testEntity, LockModeType.NONE, session );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
assertNoLokIsApplied( scope );
|
assertNoLokIsApplied( scope );
|
||||||
|
@ -93,11 +93,11 @@ public class BatchAndLockTest {
|
||||||
assertFalse( Hibernate.isInitialized( proxy ) );
|
assertFalse( Hibernate.isInitialized( proxy ) );
|
||||||
|
|
||||||
TestEntity testEntity = session.find( TestEntity.class, 1 );
|
TestEntity testEntity = session.find( TestEntity.class, 1 );
|
||||||
assertEntityLockMode( testEntity, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( testEntity, LockModeType.NONE, session );
|
||||||
|
|
||||||
// batching is enabled because LockMode = NONE, so the proxy has been initialized
|
// batching is enabled because LockMode = NONE, so the proxy has been initialized
|
||||||
assertTrue( Hibernate.isInitialized( proxy ) );
|
assertTrue( Hibernate.isInitialized( proxy ) );
|
||||||
assertEntityLockMode( proxy, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( proxy, LockModeType.NONE, session );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
assertNoLokIsApplied( scope );
|
assertNoLokIsApplied( scope );
|
||||||
|
@ -108,7 +108,7 @@ public class BatchAndLockTest {
|
||||||
scope.inTransaction(
|
scope.inTransaction(
|
||||||
session -> {
|
session -> {
|
||||||
TestEntity testEntity = session.find( TestEntity.class, 1, LockModeType.NONE );
|
TestEntity testEntity = session.find( TestEntity.class, 1, LockModeType.NONE );
|
||||||
assertEntityLockMode( testEntity, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( testEntity, LockModeType.NONE, session );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
assertNoLokIsApplied( scope );
|
assertNoLokIsApplied( scope );
|
||||||
|
@ -122,11 +122,11 @@ public class BatchAndLockTest {
|
||||||
assertFalse( Hibernate.isInitialized( proxy ) );
|
assertFalse( Hibernate.isInitialized( proxy ) );
|
||||||
|
|
||||||
TestEntity testEntity = session.find( TestEntity.class, 1, LockModeType.NONE );
|
TestEntity testEntity = session.find( TestEntity.class, 1, LockModeType.NONE );
|
||||||
assertEntityLockMode( testEntity, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( testEntity, LockModeType.NONE, session );
|
||||||
|
|
||||||
// batching is enabled because LockMode = NONE, so the proxy has been initialized
|
// batching is enabled because LockMode = NONE, so the proxy has been initialized
|
||||||
assertTrue( Hibernate.isInitialized( proxy ) );
|
assertTrue( Hibernate.isInitialized( proxy ) );
|
||||||
assertEntityLockMode( proxy, LockModeType.OPTIMISTIC, session );
|
assertEntityLockMode( proxy, LockModeType.NONE, session );
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
assertNoLokIsApplied( scope );
|
assertNoLokIsApplied( scope );
|
||||||
|
|
Loading…
Reference in New Issue