Skip to content

Commit

Permalink
Enable SerializableTransactionRunner to retry transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Aug 9, 2024
1 parent 0204262 commit d2cdb8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/src/bamboo/core/DbPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jdbi.v3.core.config.ConfigRegistry;
import org.jdbi.v3.core.statement.Slf4JSqlLogger;
import org.jdbi.v3.core.statement.StatementContext;
import org.jdbi.v3.core.transaction.SerializableTransactionRunner;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;
import org.skife.jdbi.v2.logging.PrintStreamLog;
import org.vibur.dbcp.ViburDBCPDataSource;
Expand Down Expand Up @@ -42,6 +43,7 @@ public DbPool(Config config) {
System.out.println("Initialized connection pool in " + (System.currentTimeMillis() - start) + "ms");

dbi = Jdbi.create(ds).installPlugin(new SqlObjectPlugin());
dbi.setTransactionHandler(new SerializableTransactionRunner());
dbi.registerArgument(new PathArgumentFactory());

if (System.getenv("SQL_LOG") != null) {
Expand Down

0 comments on commit d2cdb8c

Please sign in to comment.