From b865294e9684c7f4dba4ed75ca444a80e81b7efb Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 30 Oct 2019 14:08:45 -0700 Subject: [PATCH] HHH-13698 : Hibernate does not recognize MySQL 8 error code 3572 as PessimisticLockException (cherry picked from commit 0c1df5fc0de4d8bc1af12ca6a3eaa7667eea0f03) --- .../src/main/java/org/hibernate/dialect/MySQLDialect.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index b7ee0fdf56..0af7f0fe38 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -527,7 +527,8 @@ public class MySQLDialect extends Dialect { @Override public JDBCException convert(SQLException sqlException, String message, String sql) { switch ( sqlException.getErrorCode() ) { - case 1205: { + case 1205: + case 3572: { return new PessimisticLockException( message, sqlException, sql ); } case 1207: