[ 
https://issues.apache.org/jira/browse/OFBIZ-3557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846573#action_12846573
 ] 

Wickersheimer Jeremy commented on OFBIZ-3557:
---------------------------------------------

The above fix is not relative to sequence issues. But i've been able to use the 
semaphore locking on storeOrder for example which actually fixes the problem of 
ID collisions.

Obviously this is not a clean solution, because it involves changing the 
service definition to use the semaphore for people who use strict sequencing.

I guess the real solution could be in between, but i am not sure how it should 
be implemented. The getNextOrderId service should do the locking inside the 
simple method and only if the strict sequencing is used. And then the lock 
should be kept until the transaction is committed, and not just until the end 
of the service.

> Enforced sequence does not work with concurrent access
> ------------------------------------------------------
>
>                 Key: OFBIZ-3557
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3557
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Wickersheimer Jeremy
>
> There is a fundamental issue with enforced sequences (for orders, invoices, 
> etc ..) and concurrency.
> For example if two users are creating an order at the same time one of them 
> will see the creation fail with a PK error. The problem is that the 
> "getNextXXXId" rely on the party accounting preference entity, but there is 
> absolutely no guarantee that the last number in the sequence gets updated 
> before another service can read it.
> This is at best very annoying when used only internally but may be 
> unpractical for e-commerce sites.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to