RE: AW: Preventing concurrent execution of an Action

2004-12-18 Thread Yee, Richard K, CTR,, DMDCWEST
truts Users Mailing List Subject: Re: AW: Preventing concurrent execution of an Action Hi Thanks for the responses. > You don't need your locked flag, it's provided by java object monitors > automatically. I actually used the lock so if the updateXML is being executed the next r

Re: AW: Preventing concurrent execution of an Action

2004-12-14 Thread Behrang Saeedzadeh
Hi Thanks for the responses. > You don't need your locked flag, it's provided by java object monitors > automatically. I actually used the lock so if the updateXML is being executed the next request won't even try and wait to aquire the lock for it and simply return. > Last question: if two use

AW: Preventing concurrent execution of an Action

2004-12-14 Thread Leon Rosenberg
Small correction, In your example there is a difference whether you have a multiprocessor machine. On a single-proc machine it will work fine (prevent second user from overwriting), on a multi-processor machine it's undefined. Regards Leon > -Ursprüngliche Nachricht- > Von: Durham David

AW: Preventing concurrent execution of an Action

2004-12-14 Thread Leon Rosenberg
Small correction, In your example there is a difference whether you have a multiprocessor machine. On a single-proc machine it will work fine (prevent second user from overwriting), on a multi-processor machine it's undefined. Regards Leon > -Ursprüngliche Nachricht- > Von: Durham David

AW: Preventing concurrent execution of an Action

2004-12-14 Thread Leon Rosenberg
Replace synchronized(UpdateXmlAction.class) with synchronized(this) and you have the same behaviour, as if you would make the whole method synchronized. You don't need your locked flag, it's provided by java object monitors automatically. BUT, synchronizing doExecute in an ac

AW: Preventing concurrent execution of an Action

2004-12-14 Thread Leon Rosenberg
Replace synchronized(UpdateXmlAction.class) with synchronized(this) and you have the same behaviour, as if you would make the whole method synchronized. You don't need your locked flag, it's provided by java object monitors automatically. BUT, synchronizing doExecute in an ac