cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <>
Subject Re: FileWritingTransformer, locking
Date Mon, 18 Feb 2002 11:04:22 GMT
On Monday 18 February 2002 11:37, Jeremy Quinn wrote:
>. . .
> While I am working out how to do this the right way, I'll fix the
> Transformer so that it writes to a temporary file as above, and if
> another person attempts to simultaneously overwrite, I can just throw
> an Excpetion and have them try again later. I would like to work out
> how to do this properly though ;)
>. . .

If you can force the temporary filename to be a unique mapping of the 
filename that you're writing, then just detecting its existence will 
tell you that another user is already writing to the same file. This 
gives you a nice "optimistic locking" that will be sufficient in most 
cases I think.

Maybe the File.createTempFile method will help you here.


To unsubscribe, e-mail:
For additional commands, email:

View raw message