-
Notifications
You must be signed in to change notification settings - Fork 65
feat: add Connection constructor and SqlDialect getter to AbstractSqlDialectHelper #815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| if (dialectHelper.getSqlDialect() == SqlDialect.FIREBIRD) { | ||
| int errorCode = e.getErrorCode(); | ||
| String sqlState = e.getSQLState(); | ||
| String msg = e.getMessage() != null ? e.getMessage().toLowerCase() : ""; | ||
|
|
||
| if (errorCode == 335544351 || "42000".equals(sqlState) || msg.contains("already exists")) { | ||
| return; | ||
| } | ||
| if (errorCode == 335544351 || "42000".equals(sqlState) || msg.contains("already exists")) { | ||
| return; | ||
| } | ||
| throw new RuntimeException("Failed to initialize audit table", e); | ||
| } | ||
| throw new RuntimeException("Failed to initialize audit table", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new refactored code, dialectHeleper can be null.
| if (dialectHelper.getSqlDialect() == SqlDialect.FIREBIRD) { | |
| int errorCode = e.getErrorCode(); | |
| String sqlState = e.getSQLState(); | |
| String msg = e.getMessage() != null ? e.getMessage().toLowerCase() : ""; | |
| if (errorCode == 335544351 || "42000".equals(sqlState) || msg.contains("already exists")) { | |
| return; | |
| } | |
| if (errorCode == 335544351 || "42000".equals(sqlState) || msg.contains("already exists")) { | |
| return; | |
| } | |
| throw new RuntimeException("Failed to initialize audit table", e); | |
| } | |
| throw new RuntimeException("Failed to initialize audit table", e); | |
| if (dialectHelper != null && dialectHelper.getSqlDialect() == SqlDialect.FIREBIRD) { | |
| int errorCode = e.getErrorCode(); | |
| String sqlState = e.getSQLState(); | |
| String msg = e.getMessage() != null ? e.getMessage().toLowerCase() : ""; | |
| if (errorCode == 335544351 || "42000".equals(sqlState) || msg.contains("already exists")) { | |
| return; | |
| } | |
| } | |
| throw new RuntimeException("Failed to initialize audit table", e); |
dieppa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new refactored code, dialectHeleper can be null.
| } | ||
| } catch (SQLException e) { | ||
| // For Informix, ignore "Table or view already exists" error (SQLCODE -310) | ||
| if (dialectHelper.getSqlDialect() == SqlDialect.INFORMIX && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same here, dialectHelper may be null
No description provided.