Skip to content

Fix/#1111#1117

Merged
hishamco merged 5 commits intosimplcommerce:masterfrom
NishantKumar-2005:fix/#1111
Feb 27, 2025
Merged

Fix/#1111#1117
hishamco merged 5 commits intosimplcommerce:masterfrom
NishantKumar-2005:fix/#1111

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

@AbdullahAlmutawa
Copy link

Works well.

@hishamco hishamco merged commit 57c413c into simplcommerce:master Feb 27, 2025
9 of 10 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.

3 participants