It should work yes

Jacques

Le 05/04/2014 15:30, Brett Palmer a écrit :
Jacques,

Thanks for the quick reply.  We also don't use clustering but we do run
multiple application servers to a single database (e.g.1 to 4).

Am I correct from your response that setting the "clustered" flag to "Y"
will work with multiple application servers.  We are running into
sequenceId collisions during load testing without this flag set.  Specially
we need the following conditional to be true so multiple application
servers don't update the sequence value concurrently:


* if (clustered) {*

* sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
"='" + this.seqName + "'" + " FOR UPDATE";     *



} else {

sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
"='" + this.seqName + "'";

}


Thanks,



Brett




On Fri, Apr 4, 2014 at 1:38 PM, Jacques Le Roux <
[email protected]> wrote:

Le 04/04/2014 18:47, Brett Palmer a écrit :

Ofbiz Users,

We upgraded our version of OFBiz a few months ago and are running through
some performance tests.  We are seeing errors in the
SequenceUtil.getNextSeqId() method when we run load tests with multiple
application servers.  Note: We normally run multiple instances of OFBiz
against the same database in production, but that version of OFBiz is a
couple years old.

In reviewing the code we are seeing a property called "clustered" that
looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
method it uses a "SELECT ... FOR UPDATE" statement to prevent other
processes

from modifying the record until the transaction is complete.  We have set
this property to 'Y' and it has resolved our error, but we want to make
sure we are using the "clustered: property correctly.


Here are my questions:

1. In general.properties the property is called "cluster" and its set to
"N".  I can't see any reference to a property "cluster" only to the
property "clustered".  I'm assuming this is a typo in the
general.properties file.  Is that correct?

Yes indeed, that's a typo I introduced. I never noticed it, because I
always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
focusedCommentId=13044590

Thanks for the typo report. I will fix it. being unnoticed for 3 years, it
seems it's no much used or people follow the DCC way.


  2.  Does the "clustered" property simply mean that multiple OFBiz
application servers are running or does it mean that we need to configure
our catalina container as a true cluster?  For example, in the
framework/catalina/ofbiz-component.xml file there is a configuration to
run
tomcat in a true container cluster.

I personnaly decided to not change things there (ie to keep the default
Tomcat session manager) and to rather use sticky sessions.
More about that at http://markmail.org/message/kr72apsujnz4gmqa

HTH

Jacques


  Thanks in advance for your help on these questions.


Brett


--


--

Reply via email to