|
10 | 10 | import java.util.Set; |
11 | 11 |
|
12 | 12 | import org.hibernate.PessimisticLockException; |
| 13 | +import org.hibernate.QueryTimeoutException; |
13 | 14 | import org.hibernate.boot.model.FunctionContributions; |
14 | 15 | import org.hibernate.boot.model.TypeContributions; |
15 | 16 | import org.hibernate.dialect.aggregate.AggregateSupport; |
@@ -352,17 +353,19 @@ public ViolatedConstraintNameExtractor getViolatedConstraintNameExtractor() { |
352 | 353 | public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() { |
353 | 354 | return (sqlException, message, sql) -> { |
354 | 355 | switch ( sqlException.getErrorCode() ) { |
355 | | - // If @@innodb_snapshot_isolation is set (default since 11.6.2), |
356 | | - // if an attempt to acquire a lock on a record that does not exist in the current read view is made, |
357 | | - // an error DB_RECORD_CHANGED will be raised. |
358 | | - case 1020: |
359 | | - return new LockAcquisitionException( message, sqlException, sql ); |
360 | 356 | case 1205: |
| 357 | + return new LockTimeoutException( message, sqlException, sql ); |
361 | 358 | case 3572: |
362 | 359 | return new PessimisticLockException( message, sqlException, sql ); |
| 360 | + case 1020: |
| 361 | + // If @@innodb_snapshot_isolation is set (default since 11.6.2), |
| 362 | + // and an attempt to acquire a lock on a record that does not exist |
| 363 | + // in the current read view is made, error DB_RECORD_CHANGED is raised. |
363 | 364 | case 1207: |
364 | 365 | case 1206: |
365 | 366 | return new LockAcquisitionException( message, sqlException, sql ); |
| 367 | + case 3024: |
| 368 | + return new QueryTimeoutException( message, sqlException, sql ); |
366 | 369 | case 1062: |
367 | 370 | // Unique constraint violation |
368 | 371 | return new ConstraintViolationException( message, sqlException, sql, ConstraintKind.UNIQUE, |
|
0 commit comments