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
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
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
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
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
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
6 matches
Mail list logo