Has anyone been able to verify this problem, or have any ideas on the
solution?

BradO

-----Original Message-----
From: Brad O'Hearne [mailto:[EMAIL PROTECTED]
Sent: Friday, February 23, 2001 7:48 PM
To: [EMAIL PROTECTED]; [email protected]
Subject: RE: Explicit file closing


I was looking through the source on this in the
org.apache.xerces.framework.XMLParser class, and it appears that the
parse(String systemId) method does not close the InputSource if an Exception
is thrown -- it appears parsing has to end gracefully for this to happen.
This would also be consistent with the results I am getting below (if an
Exception, the file is locked, if it ends gracefully, the file is free).
Perhaps I am overlooking something, but the parse method isn't inside a
try-catch.  If I have read this correctly, I would throw the call to the
parse(InputSource is) that resides inside the parse(String systemId) method
inside a try-catch block with a finally that closes the InputSource.  Let me
know if this seems right -- perhaps I missed something.

Thanks in advance,

BradO

-----Original Message-----
From: Brad O'Hearne [mailto:[EMAIL PROTECTED]
Sent: Friday, February 23, 2001 6:55 PM
To: [EMAIL PROTECTED]
Subject: Explicit file closing


Hello all,

I ran into an interesting problem tonight.  I am using a SAX2 parser.  My
app moves my xml file to a new directory immediately following parsing, or
if parsing is aborted after a SAXException is thrown.  I am getting an
access conflict on the file trying to move my file following a SAXException
being thrown and parsing being aborted.  I have checked the XMLReader
interface and noticed that there are no methods declared for explicitly
closing the underlying file.  Is there some way for the app to explicitly
control the closing of the file, and if not, should this be added?  (I guess
another question is when exactly is the file being closed now?)

Thanks in advance for help!

BradO


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

Reply via email to