Re: ShoppingCart has very bad locking
Posted by
Adrian Crum-2 on
Mar 12, 2010; 10:24pm
URL: http://ofbiz.116.s1.nabble.com/ShoppingCart-has-very-bad-locking-tp1591136p1591221.html
--- On Fri, 3/12/10, Adam Heath <
[hidden email]> wrote:
> Search for synchronized in
> ShoppingCart. You'll fine a couple of
> spots that lock on cartLines, a few that lock in the class
> instance
> itself. But then no other hits.
>
> However, tons of internal variables all need to be kept
> self-consistent with each other, so locking against just
> one or the
> other of those variables won't work.
These same problems exist in a number of classes - not just the shopping cart (take a look at SequenceUtil for some really scary code). That's why I suggested a synchronization best practices page that the community can follow.
-Adrian