File tree Expand file tree Collapse file tree 5 files changed +18
-4
lines changed
test/java/org/hibernate/orm/test/locking/scope Expand file tree Collapse file tree 5 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -417,10 +417,14 @@ public Boolean getFollowOnLocking() {
417417 */
418418 @ Deprecated (since = "7.1" )
419419 public LockOptions setFollowOnLocking (Boolean followOnLocking ) {
420- if ( followOnLocking != null ) {
421- this .followOnStrategy = followOnLocking == Boolean .FALSE
422- ? Locking .FollowOn .DISALLOW
423- : Locking .FollowOn .FORCE ;
420+ if ( followOnLocking == null ) {
421+ this .followOnStrategy = Locking .FollowOn .ALLOW ;
422+ }
423+ else {
424+ this .followOnStrategy = followOnLocking
425+ ? Locking .FollowOn .FORCE
426+ // todo : DISALLOW or IGNORE?
427+ : Locking .FollowOn .IGNORE ;
424428 }
425429 return this ;
426430 }
Original file line number Diff line number Diff line change 66
77import jakarta .persistence .LockModeType ;
88import org .hibernate .Hibernate ;
9+ import org .hibernate .dialect .HSQLDialect ;
910import org .hibernate .dialect .RowLockStrategy ;
1011import org .hibernate .dialect .lock .PessimisticLockStyle ;
1112import org .hibernate .testing .jdbc .SQLStatementInspector ;
1516import org .hibernate .testing .orm .junit .RequiresDialectFeature ;
1617import org .hibernate .testing .orm .junit .SessionFactory ;
1718import org .hibernate .testing .orm .junit .SessionFactoryScope ;
19+ import org .hibernate .testing .orm .junit .SkipForDialect ;
1820import org .hibernate .testing .orm .transaction .TransactionUtil ;
1921import org .junit .jupiter .api .AfterEach ;
2022import org .junit .jupiter .api .BeforeEach ;
@@ -69,6 +71,7 @@ void testFindWithLocking(SessionFactoryScope factoryScope) {
6971 }
7072
7173 @ Test
74+ @ SkipForDialect (dialectClass = HSQLDialect .class , reason = "See https://sourceforge.net/p/hsqldb/bugs/1734/" )
7275 void testQueryJoiningTagsWithLocking (SessionFactoryScope factoryScope ) {
7376 // NOTE: roughly the same expectations as #testFindWithExtendedLocking,
7477 // but here the `book_tags` table should also get locked
Original file line number Diff line number Diff line change 88import jakarta .persistence .PessimisticLockScope ;
99import org .hibernate .Hibernate ;
1010import org .hibernate .Locking ;
11+ import org .hibernate .dialect .HSQLDialect ;
1112import org .hibernate .testing .jdbc .SQLStatementInspector ;
1213import org .hibernate .testing .orm .junit .DialectFeatureChecks ;
1314import org .hibernate .testing .orm .junit .DomainModel ;
1415import org .hibernate .testing .orm .junit .Jira ;
1516import org .hibernate .testing .orm .junit .RequiresDialectFeature ;
1617import org .hibernate .testing .orm .junit .SessionFactory ;
1718import org .hibernate .testing .orm .junit .SessionFactoryScope ;
19+ import org .hibernate .testing .orm .junit .SkipForDialect ;
1820import org .hibernate .testing .orm .transaction .TransactionUtil ;
1921import org .junit .jupiter .api .AfterEach ;
2022import org .junit .jupiter .api .BeforeEach ;
@@ -76,6 +78,7 @@ void testFindWithExtendedLocking(SessionFactoryScope factoryScope) {
7678 }
7779
7880 @ Test
81+ @ SkipForDialect (dialectClass = HSQLDialect .class , reason = "See https://sourceforge.net/p/hsqldb/bugs/1734/" )
7982 void testQueryJoiningTagsWithExtendedLocking (SessionFactoryScope factoryScope ) {
8083 // NOTE: roughly the same expectations as #testFindWithExtendedLocking,
8184 // but here the `book_tags` table should also get locked
Original file line number Diff line number Diff line change 77import jakarta .persistence .LockModeType ;
88import org .hibernate .Hibernate ;
99import org .hibernate .Locking ;
10+ import org .hibernate .dialect .HSQLDialect ;
1011import org .hibernate .testing .jdbc .SQLStatementInspector ;
1112import org .hibernate .testing .orm .junit .DialectFeatureChecks ;
1213import org .hibernate .testing .orm .junit .DomainModel ;
1314import org .hibernate .testing .orm .junit .Jira ;
1415import org .hibernate .testing .orm .junit .RequiresDialectFeature ;
1516import org .hibernate .testing .orm .junit .SessionFactory ;
1617import org .hibernate .testing .orm .junit .SessionFactoryScope ;
18+ import org .hibernate .testing .orm .junit .SkipForDialect ;
1719import org .hibernate .testing .orm .transaction .TransactionUtil ;
1820import org .junit .jupiter .api .AfterEach ;
1921import org .junit .jupiter .api .BeforeEach ;
@@ -69,6 +71,7 @@ void testFindWithFetchLocking(SessionFactoryScope factoryScope) {
6971 }
7072
7173 @ Test
74+ @ SkipForDialect (dialectClass = HSQLDialect .class , reason = "See https://sourceforge.net/p/hsqldb/bugs/1734/" )
7275 void testQueryJoiningTagsWithFetchLocking (SessionFactoryScope factoryScope ) {
7376 final SQLStatementInspector sqlCollector = factoryScope .getCollectingStatementInspector ();
7477
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ else if ( rowLockStrategy == RowLockStrategy.COLUMN_NAME ) {
136136 aliases = buffer .toString ();
137137 }
138138 else {
139+ assert rowLockStrategy == RowLockStrategy .COLUMN ;
139140 final StringBuilder buffer = new StringBuilder ();
140141 boolean firstPass = true ;
141142 for ( Table table : tablesFetched ) {
You can’t perform that action at this time.
0 commit comments