12
12
13
13
import jakarta .persistence .Timeout ;
14
14
import org .hibernate .QueryTimeoutException ;
15
- import org .hibernate .Timeouts ;
16
15
import org .hibernate .boot .model .FunctionContributions ;
17
16
import org .hibernate .boot .model .TypeContributions ;
18
17
import org .hibernate .dialect .aggregate .AggregateSupport ;
19
18
import org .hibernate .dialect .aggregate .MySQLAggregateSupport ;
20
19
import org .hibernate .dialect .function .CommonFunctionFactory ;
21
20
import org .hibernate .dialect .identity .IdentityColumnSupport ;
22
21
import org .hibernate .dialect .identity .MariaDBIdentityColumnSupport ;
23
- import org .hibernate .dialect .lock .spi .LockTimeoutStyle ;
24
22
import org .hibernate .dialect .sequence .MariaDBSequenceSupport ;
25
23
import org .hibernate .dialect .sequence .SequenceSupport ;
26
24
import org .hibernate .dialect .sql .ast .MariaDBSqlAstTranslator ;
@@ -280,7 +278,9 @@ public SequenceInformationExtractor getSequenceInformationExtractor() {
280
278
281
279
@ Override
282
280
public boolean supportsSkipLocked () {
283
- //only supported on MySQL and as of 10.6
281
+ // only supported on MariaDB as of 10.6 (and MySQL 8.0)
282
+ // - MySQLDialect supports >= 8.0 so not overridden from the default (true) there.
283
+ // - however, MariaDBDialect supports >= 10.5 so we need to check
284
284
return getVersion ().isSameOrAfter ( 10 , 6 );
285
285
}
286
286
@@ -306,14 +306,6 @@ protected boolean supportsAliasLocks() {
306
306
return false ;
307
307
}
308
308
309
- @ Override
310
- public LockTimeoutStyle getLockTimeoutStyle (Timeout timeout ) {
311
- if ( timeout .milliseconds () == Timeouts .SKIP_LOCKED_MILLI && !supportsSkipLocked () ) {
312
- return LockTimeoutStyle .UNSUPPORTED ;
313
- }
314
- return LockTimeoutStyle .QUERY ;
315
- }
316
-
317
309
@ Override
318
310
public Timeout getLockTimeout (Connection connection , SessionFactoryImplementor factory ) {
319
311
// technically, Hibernate should never use these due to MariaDB supporting LockTimeoutStyle.QUERY;
0 commit comments