pzampino commented on code in PR #1146:
URL: https://github.com/apache/knox/pull/1146#discussion_r2804494200
##########
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/TokenStateDatabase.java:
##########
@@ -60,11 +66,20 @@ public class TokenStateDatabase {
private final DataSource dataSource;
+ private static final String POSTGRES_DUPLICATE_OBJECT_STATE = "42710";
+
TokenStateDatabase(DataSource dataSource, String dbType) throws Exception {
this.dataSource = dataSource;
DatabaseType databaseType = DatabaseType.fromString(dbType);
- createTableIfNotExists(TOKENS_TABLE_NAME, databaseType.tokensTableSql());
- createTableIfNotExists(TOKEN_METADATA_TABLE_NAME,
databaseType.metadataTableSql());
+ try {
+ createTableIfNotExists(TOKENS_TABLE_NAME, databaseType.tokensTableSql());
Review Comment:
Not necessarily for this PR, but I wonder if executing these in a single
Statement execution might help minimize the potential for the "already exists"
error while improving efficiency slightly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]