Skip to main content
Answer

Placing Multiple Orders at the Same Time

  • May 5, 2025
  • 1 reply
  • 52 views

I am working on the a Customization Project, where are I have create a new screen in which Inventory and available quantity to order is mentioned.

Only Available quantity is allowed to order.

 

Problem:-

When multiple orders are placed at the same time from different instances, the order are getting resolved parallelly due to which the initial quantity available to order are getting conveyed to all the orders, which is incorrect

All the orders should have been resolved in a queue.

 

Please help me to resolve this issue

 

Best answer by Rakshanda

Hi ​@anupusefulbi ,

We can use PXTransactionScope
To avoid concurrency issues, enforce locking at the database transaction level 

using (PXTransactionScope ts = new PXTransactionScope()) {

//your logic

ts.Complete(); }

This ensures no other process can read/update the same row until the current transaction completes.

Hope above helps!!

1 reply

Forum|alt.badge.img+1
  • Jr Varsity II
  • Answer
  • May 6, 2025

Hi ​@anupusefulbi ,

We can use PXTransactionScope
To avoid concurrency issues, enforce locking at the database transaction level 

using (PXTransactionScope ts = new PXTransactionScope()) {

//your logic

ts.Complete(); }

This ensures no other process can read/update the same row until the current transaction completes.

Hope above helps!!