We have an web application which is running under Load balancer.Two users are trying to do the same operation for example both are raising a same order at same time which is creating duplicate orders.
Before one transaction commit another request is checking is there any order.It's creating duplicate entries.Both the request are trying to process at the same time.
We have tried the below options,
OPTIMISTIC_FORCE_INCREMENT
but none of the options helped.
Kindly suggest how to proceed.
Thanks
Set up a separate database table containing the next order number.
Split the creation of an order into two separate database transactions.
The first one reads and updates the order number.
The second one stores the order information.
When processing an order, if the first transaction fails, it should be retried before proceeding with the second transaction.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.