Hi Ajay, IndexReader.unlock() is a brute force call to be used by applications/users knowing that a lock can be safely removed.
finalize() on the other hand is a method that Java will call when garbage collecting a no-more-referenced object. So it is often a place for cleanup code. However the problem with finalize is that it is not guaranteed when it will be called, and in fact it is not guaranteed that it will be called at all (even as the JVM shutsdown). Therefore it is not recommended to have logic dependency in finalize(), and Lucene in fact does not have such, as write locks are released elsewhere. HTH, Doron On Thu, Jan 31, 2008 at 8:40 AM, ajay_garg < [EMAIL PROTECTED]> wrote: > > Hi all. > > I will be obliged, if someone could elaborate as to what is the difference > between IndexReader.unlock() and IndexWriter.finalize() methods. > > Thanks > Ajay Garg > -- > View this message in context: > http://www.nabble.com/A-small-doubt-related-to-write.lock-tp15199037p15199037.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >