RE: Waiting for lock file problem

2009-05-16 Thread Newman, Billy
t: Re: Waiting for lock file problem OK, you're right (to expect/hope that Lucene's locking would work like this). Unfortunately all of Lucene's current LockFactory impls are overly simplistic: they try once per second (by default), up until your timeout, to acquire the lock. If they

Re: Waiting for lock file problem

2009-05-16 Thread Michael McCandless
f for. > > And yes I know that I shouldn't open a new index writer for each document > added but I was just trying this so that lucene wold release the lock file so > that the application would be able to obtain the lock.  I.E. I am trying to > get the simplest case to work. &

RE: Waiting for lock file problem

2009-05-16 Thread Newman, Billy
ucene wold release the lock file so that the application would be able to obtain the lock. I.E. I am trying to get the simplest case to work. Also this is a simple lock file problem, and yes I understand what the lock file is used for (i.e. to enforce that two apps cannot access the index at the

Re: Waiting for lock file problem

2009-05-15 Thread Michael McCandless
e IndexWriter > > Application > > 1.       Application submits one new element > > 2.       Create IndexWriter (this gets the lock) > > 3.       Add document > > 4.       Optimize IndexWriter > > 5.       Close IndexWriter > > So again my problem is that the app

Waiting for lock file problem

2009-05-15 Thread Newman, Billy
. Close IndexWriter So again my problem is that the application cannot get the lock file while I am building the index file. I am sure that the writer in the build indices loop is closed after each element is added therefore releasing the lock. I have set the WRITE_LOCK_TIMEOUT to 10 seconds

Re: Obtain Lock file timeout during deleteDocument()

2007-05-30 Thread Martin Kobele
On Wednesday 30 May 2007 11:53:09 Martin Kobele wrote: > On Wednesday 30 May 2007 11:49:41 Michael McCandless wrote: > > You are only using a single instance of IndexReader, right? If for > > example you try to make a new instance of IndexReader and then call > > deleteDocument on that new one, th

Re: Obtain Lock file timeout during deleteDocument()

2007-05-30 Thread Martin Kobele
xReader is actually a > > MultiReader. Therefore the variable directoryOwner is set to true and as > > the first step, a lock file is created. After that, the document is > > marked as deleted. > > > > If I call deleteDocument again, it may or may not work. > > Now by

Re: Obtain Lock file timeout during deleteDocument()

2007-05-30 Thread Michael McCandless
set to true and as the first step, a > lock file is created. After that, the document is marked as deleted. > > If I call deleteDocument again, it may or may not work. > Now by just reading the code, and I am sure I am missing some details, I am > wondering, how can I successful

Obtain Lock file timeout during deleteDocument()

2007-05-30 Thread Martin Kobele
IndexReader.deleteDocument() for the _first_ time. If my index has several segments, my IndexReader is actually a MultiReader. Therefore the variable directoryOwner is set to true and as the first step, a lock file is created. After that, the document is marked as deleted. If I call deleteDocument again

Re: 2.1 lock file name

2007-02-20 Thread Michael McCandless
On Tue, 20 Feb 2007 10:36:55 +0100, "jm" <[EMAIL PROTECTED]> said: > I updated my code to use 2.1 (IndexWriter deleting docs etc), and when > using native locks I still get a lock like this: > lucene-2361bf484af61abc81e6e7f412ad43af-n-write.lock > and when using SimpleFSLockFactory: > lucene-2361

2.1 lock file name

2007-02-20 Thread jm
. LUCENE-771: The default location of the write lock is now the index directory, and is named simply "write.lock" (without a big digest prefix). Not a big deal, just wondering if changes.txt is wrong or it refers to some other lock file. thanks for the 2.1 release to

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 clau

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:

lock file of lucene

2006-09-27 Thread jacky
hi, When writing into an index, lucene will create a write lock file. So, if there is an error during the writing. the lock file will not be deleted. And also the JVM will not be closed for some time. So the program will have no chance to get lock of this index. Is there any method to avoid

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

Lock File

2006-06-29 Thread WATHELET Thomas
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?

Re: lock file race conditions

2005-11-01 Thread Chris Hostetter
ctory and : then setting it to read only. that way when the above tries to create : the index it throws an exception. : : I was guessing the delay was is because something else is holding onto : the file but I wasn't sure in terms of lucene how to make sure the lock : file is deleted if an exce

Re: lock file race conditions

2005-11-01 Thread Dan Adams
g onto the file but I wasn't sure in terms of lucene how to make sure the lock file is deleted if an exception like the above is thrown. On Tue, 2005-11-01 at 11:42 -0800, Chris Hostetter wrote: > 1) how do you simulate the exception? > 2) you didn't say you got a lock timeout

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

lock file race conditions

2005-11-01 Thread Dan Adams
I have 2 junit tests. The first opens on index writer and then simulates have an IOException get throw when trying to add a document. The test that runs after than is just a normal test of the search. After the first test completes a lock file is left in /tmp. Now, if I run the test suite normally

lock file in tomcat

2005-10-01 Thread Darek Czarkowski
Hello, Based on what criteria is the lock file name created? I have a multiple applications deployed on the same instance of tomcat, each one of them has its own documents, and lucene index. is write lock also unique to each of the applications? If you have multiple instances of tomcat on the

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

Re: Lock File exceptions

2005-06-27 Thread Yousef Ourabi
gments (No such file or directory) On 6/27/05, Yousef Ourabi <[EMAIL PROTECTED]> wrote: > Hello: > I get this lock-file exception on both Windows and Linux, my app is > running inside tomcat 5.5.9, jvm 1.5.03...has anyone seen this before? > > If I delete the LOCK file it w

Lock File exceptions

2005-06-27 Thread Yousef Ourabi
Hello: I get this lock-file exception on both Windows and Linux, my app is running inside tomcat 5.5.9, jvm 1.5.03...has anyone seen this before? If I delete the LOCK file it works, but obviously I shouldn't do that...Just wondering what's up? IOException caught here: Lock obtain timed

Re: indexdir/segments (No such file or directory) lock file present..

2005-05-12 Thread Ramya
I have chenged my logic as suggested.. boolean create = !(new File("indexdir/segments").exists()); System.out.println("Number of objects writing to index=" + count); index = new IndexWriter(d, new StandardAnalyzer(), create); But still one problem persists..When i do a huge number of documents, th

RE: indexdir/segments (No such file or directory) lock file present..

2005-05-12 Thread Monsur Hossain
Ramya. I don't have an answer to your specific lock file question, but a couple thoughts. You say you're using multiple threads to index 50,000 documents. Have you tried a single thread version first? I'd try that, and then scale out to multiple threads as needed. We index over

indexdir/segments (No such file or directory) lock file present..

2005-05-12 Thread Ramya
); } catch(IOException e) { index = new IndexWriter("indexdir", new StandardAnalyzer(), true); } index.addDocument(x.doc); index.close(); I have the following problem. 1. Somehow one lock file remains in the tmp direc