This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 8d3acdc11ef04890718fc8e6d24063daa254ebfe
Author: Mark Struberg <strub...@apache.org>
AuthorDate: Sat Apr 3 16:08:13 2021 +0200

    OPENJPA-2857 handle sqlState 70100 as QueryTimeoutException
---
 .../src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java   | 3 ++-
 .../resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java 
b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java
index 30adc89..78d608f 100644
--- 
a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java
+++ 
b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java
@@ -469,7 +469,8 @@ public class MariaDBDictionary extends DBDictionary {
 
     @Override
     public boolean isFatalException(int subtype, SQLException ex) {
-        if ((subtype == StoreException.LOCK  && ex.getErrorCode() == 1205)
+        if ((subtype == StoreException.LOCK  && ex.getErrorCode() == 1205) // 
ER_LOCK_WAIT_TIMEOUT
+          ||(subtype == StoreException.LOCK  && ex.getErrorCode() == 1969) // 
general ER_STATEMENT_TIMEOUT
           ||(subtype == StoreException.LOCK  && 
"JZ0002".equalsIgnoreCase(ex.getSQLState()))
           ||(subtype == StoreException.QUERY && ex.getErrorCode() == 1317)) {
             return false;
diff --git 
a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
 
b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
index 7460a26..afcff44 100644
--- 
a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
+++ 
b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
@@ -164,7 +164,7 @@
        </dictionary>
 
     <dictionary class="org.apache.openjpa.jdbc.sql.MariaDBDictionary">
-        <lock>41000</lock>
+        <lock>41000,70100</lock>
         
<referential-integrity>630,839,840,893,1062,1169,1215,1216,1217,1451,1452,1557</referential-integrity>
         <object-exists>23000</object-exists>
         <object-not-found></object-not-found>

Reply via email to