[ 
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, opinions?

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

Reply via email to