On Jun 17, 2009, at 22:50, Aaron Smuts wrote:

We need to think through the way updates are done. If these will be shared, we'll have to have some kind of lock, perhaps another file with the same name with a .lock suffix. . . . . .

As you see from the patch, I create a new tmp file and rename it after write. Several writers can write in parallel, and the last will win.

File tmp = File.createTempFile("cache", null, dir);
...
tmp.renameTo(file);

Regards,
 - Tore.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jcs-users-h...@jakarta.apache.org

Reply via email to