Skip to content

fix: add row-level locking to RemittanceRepository.upsert#747

Merged
Haroldwonder merged 1 commit into
Haroldwonder:mainfrom
DevKingOche:fix/648-remittance-upsert-row-lock
Jun 1, 2026
Merged

fix: add row-level locking to RemittanceRepository.upsert#747
Haroldwonder merged 1 commit into
Haroldwonder:mainfrom
DevKingOche:fix/648-remittance-upsert-row-lock

Conversation

@DevKingOche
Copy link
Copy Markdown

Closes #648

Wrap the upsert in an explicit transaction with SELECT ... FOR UPDATE before the INSERT ... ON CONFLICT DO UPDATE. This prevents lost updates when two concurrent calls race on the same transaction_id.

Wrap the upsert in a transaction with SELECT ... FOR UPDATE to prevent
lost updates under concurrent writes for the same transaction_id.

Closes Haroldwonder#648
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@DevKingOche is attempting to deploy a commit to the Harold's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@DevKingOche Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Haroldwonder Haroldwonder merged commit 8d02702 into Haroldwonder:main Jun 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RemittanceRepository.upsert uses INSERT ON CONFLICT without row-level locking

2 participants