I experienced a fourth possibility, although it could be considered a
variant of the third one.  I was storing an object map (a Cayenne
ObjectContext) in a ThreadLocal and I wasn't clearing the ThreadLocal
immediately at the end of each request.  In rare circumstances, when a
second user started a request at the same time another request ended, the
second user could see the first one's objects.  App servers (Jetty in my
case) generally use thread pooling.



On Mon, May 21, 2012 at 5:36 AM, Lance Java <[email protected]>wrote:

> Without seeing any code it's hard to tell but there are only a couple of
> ways
> for user A to see user B's data.
>
> 1. You have initialized a page/component variable in the field declaration
> (or the constructor). This is the most likely candidate. Mutable objects
> MUST NOT be initialized in the field declaration or constructor and must be
> initialized in onActivate() / beginRender() etc.
>
> 2. You have a mutable static variable (almost always a bad idea)
>
> 3. You have a mutable variable on a singleton service (again, most of the
> time this is a bad idea).
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/t5-3-x-Potential-Static-Util-Class-Concurrency-Issue-tp5712809p5712819.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to