[
https://issues.apache.org/jira/browse/OFBIZ-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037536#comment-13037536 ]
Philippe Mouawad commented on OFBIZ-2353:
-----------------------------------------
Hello Jacques,
For Ofbiz we implemented a native DB Sequence since the target DB is Oracle, we used a sequence with INCREMENT BY N where N is >= 50.
I was talking about select for update but it was in another different context where I had to create a DB independent algo to generate unique ID in a clustered environment.
In your case if you put maxTries to 100, you may have a contention point in the worst case since you may lock between 500 ms to 5s.
But maybe you can reduce the risk by increasing bankSize to 50 or 100 then sequence generation will be less used.
Regards
Philippe
> SequenceUtil may generate duplicate IDs in Load Balancing mode
> ---------------------------------------------------------------
>
> Key: OFBIZ-2353
> URL:
https://issues.apache.org/jira/browse/OFBIZ-2353> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: Release Branch 4.0, Release Branch 09.04, SVN trunk
> Reporter: Philippe Mouawad
> Assignee: Adam Heath
> Priority: Critical
>
> If Ofbiz is deploy on 2 servers in Load Balancing Mode
> SequenceUtil will generate duplicate IDs because synchronization is done at JVM level instead of doing it in DB.
> A good replacement implementation would be:
> org.hibernate.id.enhanced.TableGenerator
> But it would involve a dependency on Hibernate
> Philippe
> www.ubik-ingenierie.com
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira