Skip to content

Commit

Permalink
set all transactions in block service to be serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
apriltuesday committed Sep 27, 2024
1 parent 8dad551 commit 990c352
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public ContiguousIdBlockService(ContiguousIdBlockRepository repository, Map<Stri
this.categoryBlockInitializations = categoryBlockInitializations;
}

@Transactional
@Transactional(isolation = Isolation.SERIALIZABLE)
public void save(Iterable<ContiguousIdBlock> blocks) {
// release block if full
blocks.forEach(block -> {if (block.isFull()) {block.releaseReserved();}});
repository.saveAll(blocks);
entityManager.flush();
}

@Transactional
@Transactional(isolation = Isolation.SERIALIZABLE)
public void save(ContiguousIdBlock block) {
// release block if full
if (block.isFull()) {
Expand Down

0 comments on commit 990c352

Please sign in to comment.