Rank: Member
Joined: 4/29/2010(UTC) Posts: 256
Thanks: 4 times Was thanked: 11 time(s) in 10 post(s)
|
I have a requirement to change how the order number are created via creating a new version of the AssignOrderNumber Task. I have been looking through the code and notice that the OrderNumberGenerator gets the seed from the database and then checks against the max order number within the orders table.
Is there a reason for doing this? The incrimination of the seed is with a lock and therefore no two threads should be inside the lock at any one time. Therefore the seed should always be greater than the max order number.
Is there a reason for this for this check?
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
This provides an extra layer of protection in the event that the WebAppSetting value is out-of-sync. This could happen if an order is added to the database outside of the application. Also, if you have multiple web servers, the lock only works on the current server, allowing for a concurrency problem on high-traffic sites. So again, the extra check should help prevent this. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.