Skip to content

Commit

Permalink
Fix could not serialize access due to concurrent update
Browse files Browse the repository at this point in the history
  • Loading branch information
bifrurcated committed Jan 15, 2024
1 parent 30639b1 commit 033c0f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WalletService(WalletRepo walletRepo) {
@Transactional(
isolation = Isolation.SERIALIZABLE,
propagation = Propagation.REQUIRES_NEW)
@Retryable(retryFor = SQLException.class, maxAttempts = 17, backoff = @Backoff(delay = 500))
@Retryable(retryFor = SQLException.class, maxAttempts = 20, backoff = @Backoff(delay = 500))
public Wallet addAmount(UUID id, Float amount) {
var wallet = walletRepo.findById(id).orElseThrow(WalletNotFoundError::new);
wallet.setAmount(wallet.getAmount() + amount);
Expand Down

0 comments on commit 033c0f2

Please sign in to comment.