Skip to content

OLMIS-8206: Reject concurrent requisition approval#127

Merged
lwojewnik merged 4 commits into
masterfrom
OLMIS-8206-reject-concurrent-approval
Jun 30, 2026
Merged

OLMIS-8206: Reject concurrent requisition approval#127
lwojewnik merged 4 commits into
masterfrom
OLMIS-8206-reject-concurrent-approval

Conversation

@michaldev0

@michaldev0 michaldev0 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Adds a server-side lock so two approvals of the same requisition cannot both run and create duplicate stock events.


This change is Reviewable

Adds a server-side lock so two approvals of the same requisition cannot both run and create duplicate stock events.
@michaldev0 michaldev0 force-pushed the OLMIS-8206-reject-concurrent-approval branch from ef87b4f to 78bde93 Compare May 31, 2026 23:29
@lwojewnik lwojewnik self-requested a review June 1, 2026 11:34

@lwojewnik lwojewnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One note about the new Redis lock. If a requisition approval ever takes longer than the 30-minute lock timeout, another user could start approving the same requisition before the first approval finishes.

This is very unlikely, but it could result in duplicate or incorrect data being created.

The lock is renewed while an approval runs and released only by the approval that took it.
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

Drops the holder class and uses constructor injection; lock behavior is unchanged.
TransactionSynchronization is not a functional interface in Spring 5.2, so it cannot be a lambda.
@lwojewnik lwojewnik merged commit b7d953e into master Jun 30, 2026
1 of 2 checks passed
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.

2 participants