Skip to content

Commit

Permalink
Bump the number of retries in transaction failures
Browse files Browse the repository at this point in the history
This can potentially help even more with serializable transaction
failures (optimistic locking exceptions, which are expected to occur
somewhat frequently).

With six attempts, we will sleep at most five times, for
100+200+400+800+1600 ms each, for a total of at most 3.1 seconds (much
less than the EPP maximum which I believe (?) to be 30 seconds.
  • Loading branch information
gbrodman committed Feb 28, 2025
1 parent ea1e8d5 commit 484b936
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
public class JpaTransactionManagerImpl implements JpaTransactionManager {

private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final Retrier retrier = new Retrier(new SystemSleeper(), 3);
private static final Retrier retrier = new Retrier(new SystemSleeper(), 6);
private static final String NESTED_TRANSACTION_MESSAGE =
"Nested transaction detected. Try refactoring to avoid nested transactions. If unachievable,"
+ " use reTransact() in nested transactions";
Expand Down

0 comments on commit 484b936

Please sign in to comment.