Bug 38060 - [PATCH] Windows File Locking Issues
Summary: [PATCH] Windows File Locking Issues
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Workflow (show other bugs)
Version: 1.2.4
Hardware: PC Windows XP
: P2 critical
Target Milestone: 1.2.6
Assignee: Lenya Developers
: 35586 (view as bug list)
Depends on:
Reported: 2005-12-28 05:51 UTC by Michael Ralston
Modified: 2010-07-10 05:39 UTC (History)
1 user (show)

org.apache.lenya.xml.DocumentHelper fix for open files. (1.88 KB, patch)
2005-12-28 05:55 UTC, Michael Ralston
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Ralston 2005-12-28 05:51:46 UTC
Alot of programmers neglect to close files when programming in Java. I guess 
they assume the garbage collector will eventually clean up these files and they 
don't have to worry about them. This causes problems with Java running on 
Windows operating systems, as they make certain demands about open files, eg 
not allowed to delete them etc. These bugs are quite hard to track down as it 
can be intermittent, the garbage collector MIGHT close the file and there won't 
be a problem... then again it might not. 
This problem manifests itself in lenya in various places. The bug isn't 
actually in lenya but in some of the xml processing infrastructure which it 
depends on. I propose rather than waiting for the developers of cocoon etc to 
fix these problems, we fix the lenya code to take care of opening the files and 
then we know somebody else isn't going to leave the file open and cause a 
The patch attached fixes one particular instance of this problem, when 
deactivating a page on windows, a file needs to be deleted but it has been left 
open by a documentParser object. 
I'm sure these file open bugs are causing problems elsewhere in lenya, I have 
seen a few things on the mailing list which I am sure is caused by the same 
sort of thing. I haven't experienced them myself as yet. In particular I'm not 
running Lenya on windows anymore so I don't know if I will be useful in 
tracking down further bugs.
Comment 1 Michael Ralston 2005-12-28 05:55:35 UTC
Created attachment 17289 [details]
org.apache.lenya.xml.DocumentHelper fix for open files.

Fix for DocumentHelper to open files itself instead of allowing DocumentParser
to do it.
Comment 2 J 2007-01-25 17:00:23 UTC
hmm. is this still an issue?
i don't like the fix at first glance, since it seems to circumvent the original
design intent... plus there are a numbe of readDocument methods that will all
have the same problem, and the fix addresses only one. is DocumentHelper the one
class that handles file i/o? if so, it should be fixed there, if not, we should
restructure the stuff so that there is just one class to ever handle files
directly, but that's probably post 1.4 stuff. wdyt?
Comment 3 J 2007-04-07 02:58:20 UTC
*** Bug 35586 has been marked as a duplicate of this bug. ***
Comment 4 J 2007-04-25 15:19:00 UTC
we need to look into this immediately after 1.4.0.
Comment 5 Richard Frovarp 2010-07-10 05:39:18 UTC
Unaware of any locking issues in 2.x. Setting back to 1.2.x.