Adrian Crum wrote:
> --- On Fri, 3/12/10, Adrian Crum <adrian.c...@yahoo.com> wrote:
>> Consistent random foreign key violations. Two records would
>> get the same sequence number. Random in that different
>> entities would be affected each time, and consistent in that
>> it happens nearly every time.
>>
>> Try running five or more threads against it on a
>> multi-processor machine.
> 
> Oops, maybe those were primary key violations. Bottom line is, an exception 
> was thrown because two records got the same sequence ID.

Well, a quick look, shows the refresh call has no locking while
updating curSeqId, which is also used by getNextSeqId and fillBank.

fillBank doesn't need to be synchronized, only the public methods,
which would still honor the contract.

Everything called by the constructor doesn't need to be synchronized
either, as object construction synchronization is based on the calling
code.

I hate DCL, it's stupid.

I'm currently doing a few little code cleanups in this file, moving
some things around, changing visibility, removing uneeded references.
 The end result will be no functional changes, the algo won't change
either, but at least should make the class follow ofbiz design
patterns better.

Reply via email to