Why don't you create the file with a temporary filename and return a link to
the file you created. If you do this, you will not have to lock your action.


-Richard


-----Original Message-----
From: Behrang Saeedzadeh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 14, 2004 3:25 PM
To: Struts 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
request won't even try and wait to aquire the lock for it and simply return.

> Last question: if two users click the link simultaneously, what should 
> happen? In your code, the second user overwrites the changes of the 
> first user (silently).

I guess what I have done ignores the second click as the control returns
from the doExecute method before reaching the updateXml method.

Regards,
Behrang S.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to