Re: [t5.3.x] Potential Static Util Class Concurrency Issue

2012-05-21 Thread Howard Lewis Ship
On Mon, May 21, 2012 at 4:54 AM, Bryan Lewis wrote: > 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 r

[t5.3.x] Potential Static Util Class Concurrency Issue

2012-05-21 Thread llama-king
Hello, First post! Woo! While using various revisions of T5.3 we ran into a strange case as follows: 1. User A fills in text field, submits form. 2. User B fills in text field, submits form. (Where 1 and 2 occur within milliseconds of each other.) 3. Events trigger, util class static method cal

Re: [t5.3.x] Potential Static Util Class Concurrency Issue

2012-05-21 Thread Lance Java
FYI you can call PerthreadManager.addThreadCleanupListener(ThreadCleanupListener listener) to cleanup any ThreadLocals. Tapestry fires the listeners at the end of each request. -- View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-x-Potential-Static-Util-Class-Concurrency-Is

Re: [t5.3.x] Potential Static Util Class Concurrency Issue

2012-05-21 Thread Bryan Lewis
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

Re: [t5.3.x] Potential Static Util Class Concurrency Issue

2012-05-21 Thread Lance Java
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 de