Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Doron Cohen
Hi, > I don't know > enough about finer points of shutdown hooks to comment on the distinctio, > but my off the cuff assumption is that a shutdown hook would be a bad idea > ... in a long running program wouldn't thta keep the IndexWriter > from being GCed until shutdown? > Could be, haven't use

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Chris Hostetter
: I think finalize() is that not trustworthy, in that it may : never be called, e.g. in case GC happened to not collect the specific : object, : and so the way for programmers to guarantee execution of any code : at shutdown is with shutdown hooks, I guess this is that what you meant, i'm not sug

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Chris Hostetter
: I like Uwe's idea. As for Hoss's original suggestion, my initial : reaction is that if a user understands the need to set the option : in the first place, they're also more likely to understand the need : for close(). my intention was that if the user used a "novice" type API for getting an In

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Erick Erickson
I like Uwe's idea. As for Hoss's original suggestion, my initial reaction is that if a user understands the need to set the option in the first place, they're also more likely to understand the need for close(). FWIW Erick On Tue, Mar 22, 2011 at 8:15 AM, Uwe Schindler wrote: > Hi, > >> I know t

RE: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Uwe Schindler
Hi, > I know there were good reasons for eliminating the "autoCommit" > functionality from IndexWriter, but threads like tis make me thing thta even > though "autoCommit" on flush/merge/whatever was bad, having an option > for some sort of "autoClose" using a finalizer might by a good idea to give

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Robert Muir
On Mon, Mar 21, 2011 at 11:21 PM, Chris Hostetter wrote: > > Anyone see a downside? > I don't think we should do anything serious in a gc finalizer. sounds like its asking for a JRE crash. - To unsubscribe, e-mail: dev-unsubscr

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Doron Cohen
Hi, > > I know there were good reasons for eliminating the "autoCommit" > > functionality from IndexWriter, but threads like tis make me thing thta > > even though "autoCommit" on flush/merge/whatever was bad, having an > option > > for some sort of "autoClose" using a finalizer might by a good i

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-22 Thread Earwin Burrfoot
On Tue, Mar 22, 2011 at 06:21, Chris Hostetter wrote: > > (replying to the dev list, see context below) > > : Unfortunately, you can't easily recover from this (except by > : reindexing your docs again). > : > : Failing to call IW.commit() or IW.close() means no segments file was > written... > >

Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.

2011-03-21 Thread Chris Hostetter
(replying to the dev list, see context below) : Unfortunately, you can't easily recover from this (except by : reindexing your docs again). : : Failing to call IW.commit() or IW.close() means no segments file was written... I know there were good reasons for eliminating the "autoCommit" func