cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rogier Peters <rog...@dds.nl>
Subject Filesource questions
Date Tue, 19 Apr 2005 11:33:13 GMT
Hi,

I think org.apache.excalibur.source.impl.FileSource is acting strange when
handling temp files:
- instead of using File.createTempFile(), it creates a temp file like this:

        // Create a temp file. It will replace the right one when writing
terminates,
        // and serve as a lock to prevent concurrent writes.
        File tmpFile = new File(getFile().getPath() + ".tmp");

- furthermore, presumably because of the lock function mentioned in the comment
above, it checks for an existing temp file, and throws a concurrent modification
exception when it exists.

The problem I'm having is that sometimes a .tmp file won't be removed after use.
The next time it tries to create a file by the same name, FileSource will throw
a concurrent modification exception, and refuses to write. Of course, at that
point there is no other process writing the file.

There is one other thread[1] where this behaviour is mentioned - when Gianugo
was working on flow/webdav - it doesn't seem to have been resolved however .

Finally - as an aside - is it really necessary to have Excalibur provide
FileSource and factory? A quick browse through cocoon.xconf shows that there are
only a few ( albeit very essential ) components that live in excalibur. From my
point of view it hinders the transparency of Cocoon - I can't see straight away
what filesource does and where it goes wrong. Imho it would be better to have
Impl's in cocoon packages, even if the interface lives somewhere else.

WDYT?

Rogier

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105966223522106&w=2

Mime
View raw message