Skip to content

Commit

Permalink
Fix concurrency issue by isolating putBase in a separate transaction
Browse files Browse the repository at this point in the history
The putBase operation is now executed in an isolated transaction to ensure it is retryable without impacting the parent transaction. This prevents concurrency issues that were previously causing conflicts in the parent transaction during import.
  • Loading branch information
ja-openai committed Aug 23, 2024
1 parent 9ad99c0 commit 6fe22c7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
* Implementation that use the database to store the blobs.
Expand Down Expand Up @@ -60,6 +62,7 @@ public void put(String name, byte[] content, Retention retention) {
});
}

@Transactional(propagation = Propagation.REQUIRES_NEW)
void putBase(String name, byte[] content, Retention retention) {
MBlob mBlob =
mBlobRepository
Expand Down

0 comments on commit 6fe22c7

Please sign in to comment.