cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Commerce Cloud B2C - Duplicate orders with same cart code and Guid

chun18
Explorer
0 Kudos
224

Hi, we've been getting duplicate orders with the same original cart code and same guid. In the logs, there are actually multiple place order requests on the same cart. We already put a constraint on the Front-end that disables the Place Order button once the user clicks on it, but we are still getting these duplicate orders. We notice that when we have a problem with database usage, high traffic, the website can be unresponsive and it will take a while to load a page, then we got these duplicate orders. Both orders are placed a couple seconds or milliseconds apart.

What could explain this? Is it because of network retries? How could we prevent this from happening again?
I did some research. An option is we could add an attribute to Cart model to indicate that the cart is being processed. But for multi-node service, will it work? If the first request read the cart and set it is being processed, will the second one see that value is updated?

We tried to put a unique constraint on the guid on Order model, but it affects the performance, so we have to remove it.
How about distributed lock?

Accepted Solutions (0)

Answers (2)

Answers (2)

cieslo
Product and Topic Expert
Product and Topic Expert

Hi,

Please check this help page: Order Versioning. If these orders have different attribute versionID it's absolutely fine, that's the way how it should work.

chun18
Explorer
0 Kudos
thanks!
cieslo
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Please check this help page: Order Versioning. Please check if these orders have different attribute versionID. If yes - that is absolutely fine.