Re: lock file of lucene

2006-09-27 Thread jacky
D]> To: Sent: Wednesday, September 27, 2006 4:55 PM Subject: Re: lock file of lucene > Hi jacky, > > Before you open IndexWriter object you can check whether lock file exists or > not and if its available you can unlock it. > Use IndexReader.isLocked and IndexRead

Re: lock file of lucene

2006-09-27 Thread Michael McCandless
Bhavin Pandya wrote: > Before you open IndexWriter object you can check whether lock file > exists or not and if its available you can unlock it. > Use IndexReader.isLocked and IndexReader.unlock. Also, you could use a try / finally and always close the IndexWriter in the finally clause, which sh

Re: lock file of lucene

2006-09-27 Thread Bhavin Pandya
Hi jacky, Before you open IndexWriter object you can check whether lock file exists or not and if its available you can unlock it. Use IndexReader.isLocked and IndexReader.unlock. - Bhavin pandya - Original Message - From: "jacky" <[EMAIL PROTECTED]> To: Sent: Wednesday, September

RE: Lock File

2006-06-30 Thread WATHELET Thomas
Ok thanks I understand now. Thanks a lot. -Original Message- From: Michael McCandless [mailto:[EMAIL PROTECTED] Sent: 30 June 2006 16:10 To: java-user@lucene.apache.org Subject: Re: Lock File > It's not possible to change lockDir because it's a final static > var

Re: Lock File

2006-06-30 Thread Michael McCandless
It's not possible to change lockDir because it's a final static varriables? Is it possible to change the lockDir? Correct, because it's final you cannot change it directly. But, you can set the Java system property org.apache.lucene.lockDir. This will change the lock directory, because the f

RE: Lock File

2006-06-30 Thread WATHELET Thomas
It's not possible to change lockDir because it's a final static varriables? Is it possible to change the lockDir? -Original Message- From: Michael McCandless [mailto:[EMAIL PROTECTED] Sent: 29 June 2006 22:26 To: java-user@lucene.apache.org Subject: Re: Lock File > Whe

Re: Lock File

2006-06-30 Thread Michael McCandless
I have a clustered environment, with a load-balancer in the front assigning connections. Is it better to have one of the cluster running a searcher as a webservice (to be accessed by the other machines in the cluster) or to have a IndexReader/Searcher for each machine in the cluster? Ahh, OK

RE: Lock File

2006-06-29 Thread Wang, Jeff
-Original Message- From: Michael McCandless [mailto:[EMAIL PROTECTED] Sent: Thursday, June 29, 2006 2:46 PM To: java-user@lucene.apache.org Subject: Re: Lock File Also: you should generally try to have a single IndexReader (and IndexSearcher using it) that's shared across all "th

Re: Lock File

2006-06-29 Thread Michael McCandless
What are the conditions that cause corruption? If there is just one writer and multiple readers, is that safe? The cases are well spelled out in Lucene in Action, section 2.9. Generally, one writer and multiple readers is not safe for disabling locking. For example, the IndexReader, when

Re: Lock File

2006-06-29 Thread joe kim
Lucene uses this lock to ensure the index does not become corrupt when IndexReaders and IndexWriters are working on the same index. What are the conditions that cause corruption? If there is just one writer and multiple readers, is that safe? ---

Re: Lock File

2006-06-29 Thread Michael McCandless
> When I create an index withe the class IndexModifier in Lucene 1.9.1there is a lock file created on a temp folder. > My question is: Is it possible to disable this option? > If yes how to procede? Yes, there is. You can call the static FSDirectory.setDisabledLocks() to disable locking enti

Re: lock file race conditions

2005-11-01 Thread Chris Hostetter
: IndexWriter writer = new IndexWriter(directory, new StandardAnalyzer(), : true); : : so if I try to close() it in a finally or something it throws a null : pointer exception since the exception was throw in the constructor. : : I'm simulating the exception by hand-creating the index directory and

Re: lock file race conditions

2005-11-01 Thread Dan Adams
Well, I'm running on linux and I thought the problem was that the writer was not being closed but the ioexception is thrown at: IndexWriter writer = new IndexWriter(directory, new StandardAnalyzer(), true); so if I try to close() it in a finally or something it throws a null pointer exception sin

Re: lock file race conditions

2005-11-01 Thread Chris Hostetter
1) how do you simulate the exception? 2) you didn't say you got a lock timeout error, you said you got a "couldnt delete the lock file" exception ... is your second test forcably trying to unlock the index? 3) are you running this test on a windows machine? 4) can you post your unit test?

Re: Lock File exceptions

2005-06-27 Thread jian chen
Hi, Recently I looked at the locking mechanism of Lucene. If I am correct, I think the process for grabbing the lock file will time out by default in 10 seconds. When the process timed out, it will print out the IOException. The lucene locking mechanism is not within threads in the same JVM. It u

Re: Lock File exceptions

2005-06-27 Thread Yousef Ourabi
Mini-Follow UP: Wouldn't the parameter boolean create false create the segments if it is not found? My understanding is that the create variable either creates or doesn't the actual directory on startup...does this affect key files as well? IOException caught here: /var/jeteye/index/segments (No s