You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2011/05/14 16:25:47 UTC

[jira] [Issue Comment Edited] (OFBIZ-2353) SequenceUtil may generate duplicate IDs in Load Balancing mode

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

Jacques Le Roux edited comment on OFBIZ-2353 at 5/14/11 2:25 PM:
-----------------------------------------------------------------

Thanks Philippe,

I agree with you CREATE SEQUENCE looks like a good solution (using PostgreSQL in my case) since with the cache option we can get the same bank 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 w/out 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, opininons?

      was (Author: jacques.le.roux):
    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