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

Jacques Le Roux commented on OFBIZ-2353:
----------------------------------------

[~jacopoc] I don't know Philippe's experience (though I know for which client 
it happened) which leads me to this fix. That's for sure resolved an issue for 
a client I worked with between 2011 and 2013. It was a clustered environment 
with 5 OFBIz servers running on a Postgres 9.1 DB cluster with 3 machines (1 
master and 2 slaves with Pgpool-II). IIRW the DB cluster was able to handle a 
limit of maximum 1500 simultaneous connections. 

The app servers used the default entityengine.xml parameters but this set of 
parameters
pool-maxsize="300" 
idle-maxsize="40" 
time-between-eviction-runs-millis="60000" (instead of 600000)

We were also using the default bank size.

With this setting we did not encounter deadlock situations. There can be 
situations were a thread wait for another to release the lock, but deadlock 
should not happen. Because the bank is only in one table, there can't be cross 
callings 
(http://www.postgresql.org/docs/9.1/static/explicit-locking.html#LOCKING-DEADLOCKS)

Ha, our comments cross wired. I believe with the SELECT FOR UPDATE there should 
not be issues like described by Adrian:
bq. There is a similar issue in the way the entity value is updated. The 
UPDATE... WHERE... statement needs to include the previous sequence value - so 
you can guarantee you are updating the same value you read.

[[email protected]]: did you encounter such issues with clustered= true?

> 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, Trunk
>            Reporter: Philippe Mouawad
>            Assignee: Jacopo Cappellato
>            Priority: Critical
>             Fix For: Release Branch 10.04, Release Branch 11.04, Trunk
>
>         Attachments: OFBIZ-2353 SELECT FOR UPDATE solution.patch, OFBIZ-2353 
> SELECT FOR UPDATE solution.patch
>
>
> 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 was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to