Skip to content

Conversation

@bercianor
Copy link
Contributor

No description provided.

Comment on lines 52 to 61
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);
Copy link
Member

@dieppa dieppa Feb 2, 2026

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.

Suggested change
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);

Copy link
Member

@dieppa dieppa left a 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 &&
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants