windows locking file problem

2009-06-19 Thread Malo Pichot
Hi,

I know a similar subject has been discussed in this list and this is not
a "windows file system" list ;-) But may be someone have encountered the
"thing"... and perhaps solved it !

I have a web application that index many documents so I have a quite
large Lucene (2.2) index (~ 350 Mo) managed by a FSDirectory. The
indexation (I mean writing in indeces) is done by batches. Each batch
works first in a RAMDirectory, wich is merged with the main index in a
third one (a temporary FSDirectory). When the merge is done, the
application have to replace the main index (untouched until this time).
Here comes the problem ! To replace, the application close the searcher,
then the FSDirectory itself. After that, the application delete all
files of the main index and then copy all files of the temporary index
in place, before re-open the FSDirectory, generate searcher, etc.

All that is good in Linux environment, and in Windows most of the time.
Yeap ! sometimes, windows FS refuses the deletion of the main index
files. Th only way I found to force windows FS unlocking those files is
to stop the servlets server (Tomcat). I can't shutdown Tomcat during the
indexation work.

I don't know how to solved that :-(

Does anyone get inspiration ?

Malo

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: windows locking file problem

2009-06-22 Thread Malo Pichot
Hello,

Thank you for help, Micheal. It works fine now. Next time I will trust
Lucene a little bit more ;-)

Malo



Michael McCandless a écrit :
> It's best to let IndexWriter manage the deletion of files (for exactly
> this reason).
> 
> It turns out, it's perfectly fine to open an IndexWriter with
> "create=true" even when IndexReaders are reading that same index.
> Those open IndexReaders continue to search their point-in-time
> snapshot, and then when they reopen they'll switch to the "reset"
> index.
> 
> So, assuming you have enough free disk space, you could leave your
> searcher open, create an IndexWriter with create=true, call
> addIndexesNoOptimize passing in your RAMDir (or, skip RAMDir and
> simply add your docs directly to this writer), then commit or close
> the writer and reopen the searcher.
> 
> Because Lucene is transactional, and assuming you use autoCommit=false
> when opening the writer, you can make all of your index updates and
> the searcher, even if reopened, will see none of these changes, until
> you've called commit/close from the writer.
> 
> Mike
> 
> On Fri, Jun 19, 2009 at 3:15 AM, Malo Pichot wrote:
>> Hi,
>>
>> I know a similar subject has been discussed in this list and this is not
>> a "windows file system" list ;-) But may be someone have encountered the
>> "thing"... and perhaps solved it !
>>
>> I have a web application that index many documents so I have a quite
>> large Lucene (2.2) index (~ 350 Mo) managed by a FSDirectory. The
>> indexation (I mean writing in indeces) is done by batches. Each batch
>> works first in a RAMDirectory, wich is merged with the main index in a
>> third one (a temporary FSDirectory). When the merge is done, the
>> application have to replace the main index (untouched until this time).
>> Here comes the problem ! To replace, the application close the searcher,
>> then the FSDirectory itself. After that, the application delete all
>> files of the main index and then copy all files of the temporary index
>> in place, before re-open the FSDirectory, generate searcher, etc.
>>
>> All that is good in Linux environment, and in Windows most of the time.
>> Yeap ! sometimes, windows FS refuses the deletion of the main index
>> files. Th only way I found to force windows FS unlocking those files is
>> to stop the servlets server (Tomcat). I can't shutdown Tomcat during the
>> indexation work.
>>
>> I don't know how to solved that :-(
>>
>> Does anyone get inspiration ?
>>
>> Malo


-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org



Re: How to solve this problem

2009-08-11 Thread Malo Pichot
石川 a écrit :
> Hi,
>   I am a newbie in lucene and am trying the 'indexing and searching'
> demo of lucene 1.4.3 using kaffe 1.0.6. After inputing the query, an error
> occurs as follows:
> 
>Query: stringSearching for: string
> java.lang.NoSuchMethodError:
> org/apache/lucene/search/Searcher.search(Lorg/apache/lucene/search/Query;Lorg/apache/lucene/search/Filter;I)Lorg/apache/
> at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:64)
> at org.apache.lucene.search.Hits.(Hits.java:43)
> at org.apache.lucene.search.Searcher.search(Searcher.java:33)
> at org.apache.lucene.search.Searcher.search(Searcher.java:27)
> at org.apache.lucene.demo.SearchFiles.main(SearchFiles.java:49)
> 
> However, when I use kaffe 1.1.0, it works well. I google for the
> error information and it is said there is something wrong with my jar
> package. Could anybody give some suggestion? Thanks.


Hello,

I think you use a wrong version of JVM, not the same version that has
been used to compile your Lune JAR.

Malo

-
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org