mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2782 - Support MariaDB jdbc driver update - Batched JDBC SQLException translation, SqlRow BLOB reading
- Batched JDBC SQLException translation - Need to dig into nested exception to get cause error state - SqlRow BLOB reading - BLOB can come as LONGVARBINARY (TestRawSqlBuilder) - Fix test for history using system time (TestHistoryInsert) - Fix SqlQueryCancelTest - Fix TestSqlUpdateExceptions
This commit is contained in:
@@ -32,7 +32,12 @@ public class SqlCodeTranslator implements SqlExceptionTranslator {
|
||||
}
|
||||
|
||||
private DataErrorType getErrorType(SQLException e) {
|
||||
DataErrorType errorType = map.get(e.getSQLState());
|
||||
String sqlState = e.getSQLState();
|
||||
while (sqlState == null && e.getCause() instanceof SQLException) {
|
||||
e = (SQLException)e.getCause();
|
||||
sqlState = e.getSQLState();
|
||||
}
|
||||
DataErrorType errorType = map.get(sqlState);
|
||||
if (errorType == null) {
|
||||
// fall back to error code
|
||||
errorType = map.get(String.valueOf(e.getErrorCode()));
|
||||
|
||||
Reference in New Issue
Block a user