Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/#1111 #1117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NishantKumar-2005
Copy link

In this code:

Fixes/#1111
The transaction is started using _checkoutItemRepository.BeginTransaction().
The product is queried and locked for update using _checkoutItemRepository.saveChanges().
The stock quantity is checked and updated within the transaction.
The transaction is committed after the order is created.
This ensures that the stock check and update are performed atomically, preventing race conditions.

Nishant added 3 commits January 5, 2025 00:20
The transaction is started using _dbContext.Database.BeginTransaction().
The product is queried and locked for update using ForUpdate().
The stock quantity is checked and updated within the transaction.
The transaction is committed after the order is created.
This ensures that the stock check and update are performed atomically, preventing race conditions.
The transaction is started using _dbContext.Database.BeginTransaction().
The product is queried and locked for update using saveChanges().
The stock quantity is checked and updated within the transaction.
The transaction is committed after the order is created.
This ensures that the stock check and update are performed atomically, preventing race conditions.
The transaction is started using _dbContext.Database.BeginTransaction().
The product is queried and locked for update using saveChanges().
The stock quantity is checked and updated within the transaction.
The transaction is committed after the order is created.
This ensures that the stock check and update are performed atomically, preventing race conditions.
@NishantKumar-2005
Copy link
Author

I don't know why the License Compliance Failed I did not use any Dependency in Code
you can Check in Changes

@hishamco
Copy link
Member

hishamco commented Jan 4, 2025

Don't worry about it for now

@hishamco
Copy link
Member

Why you closed the PR?

@NishantKumar-2005
Copy link
Author

Due to no response , I reopened it

@hishamco
Copy link
Member

@NishantKumar-2005 please format your code

@AbdullahAlmutawa please your review

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