Home | About | Sematext search-lucene.com search-hadoop.com
 Search Lucene and all its subprojects:

Switch to Threaded View
Tika, mail # user - Tika leaves files open


Copy link to this message
-
RE: Tika leaves files open
Uwe Schindler 2011-08-31, 17:29
Except when you have to close multiple resources... Also, JDBC throws
Exceptions quite often on close :-)

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [EMAIL PROTECTED]
> -----Original Message-----
> From: Jukka Zitting [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 31, 2011 7:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Tika leaves files open
>
> Hi,
>
> On Wed, Aug 31, 2011 at 6:53 PM, Uwe Schindler <[EMAIL PROTECTED]> wrote:
> > For this typical try...finally code I suggest to use a pre-Java-7.0
> > workaround to make this behave more correct: If you do try...finally
> > and another Exception occurs on close() in the finally block, you lose
> > the first Exception.
>
> Such a case is certainly possible scenario, but in my experience it
practically
> never occurs. I've used the try { ... } finally { stream.close(); }
pattern
> extensively for years, and I've never seen a case where information was
lost
> because of this.
>
> So personally I consider the problem rather theoretical and would rather
opt
> for cleaner code that avoids the extra constructs.
>
> BR,
>
> Jukka Zitting