Re: using lucene Lock inter-jvm

2006-06-21 Thread Yonik Seeley
On 6/21/06, Michael McCandless <[EMAIL PROTECTED]> wrote: Does anyone know of any reasons not to switch Lucene's FSDirectory locking to the java.nio.channels.FileLock? EG, are there any performance issues that people are aware of? It's available since Java 1.4. Good question Michael, no reaso

Re: using lucene Lock inter-jvm

2006-06-21 Thread Michael McCandless
CC'ing java-dev to talk about details of locking. I can reproduce this on Windows XP, Java 1.4.2: two separate JVMs are able to get the Lock at the same time. The code looks correct to me. Strangely, if I make a separate standalone test that just uses java.io.File.createNewFile directly, it wo

Re: using lucene Lock inter-jvm

2006-06-21 Thread jm
ok, in case somebody has the same problem: The problem is the true value in FSDirectory directory = FSDirectory.getDirectory("C:\\temp\\a", true); it deletes the previous lock file, that belongs to the lock adquired by the first process. Changing it to false prevents the lock being deleted and loc