[
https://issues.apache.org/jira/browse/OFBIZ-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033536#comment-13033536 ]
Jacques Le Roux commented on OFBIZ-2353:
----------------------------------------
Thanks Philippe,
I agree with you CREATE SEQUENCE looks like a good solution (using PostgreSQL) since with the cache option we can get the same behaviour than OOTB, but in a reliable manner (at DBMS level). Obviously it's not used in OFBIz because it introduces an OOTB unacceptable database dependency (Note: Derby supports it since 10.6, but not cache yet, WIP: DERBY-5151).
I will see if I get enough time to reliably implement Karl's proposition, else this issue will stay opened. Though I wonder now if we could not rather implement a switchable by property alternative using CREATE SEQUENCE. It could then be used by clustered applications using most important DBMSs (Postgres, Oracle, DB2, MS-SQL). In DERBY-5151 they discuss about slight syntax differences, this could be handled in OFBiz...
To note: like with current OOTB solution, if you use cache with CREATE SEQUENCE you can get holes in the numbering...
Other propositions?
> 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