Re: Lucene write locks

2008-07-25 Thread Michael McCandless
It's not enough to have a synchronized block only, unless eg within the synchronized block you open the IndexWriter, add docs, close it. Basically, you must also ensure only one instance of IndexWriter is open at once. If you try to open another instance of IndexWriter while a previous

Re: Lucene write locks

2008-07-25 Thread Sandeep K
Hi Mike, sorry i didn't get much of it. i tried with synchronized block also. but it was a failure. will it be enough to have a synchronized block only? if each instance of IndexWriter is thread safe, then do we need to check whether its open or closed each time? why it's not doing the work eve

Re: Lucene write locks

2008-07-25 Thread Michael McCandless
I think the simplest approach is to use a synchronized block in your application to check if an IndexWriter is currently open, and if so, use that one to add your docs, else, open a new one and store it in a central place where the next message to come in can go and find it? Each instance

Re: Lucene write locks

2008-07-25 Thread Sandeep K
Hey Michael, Thanks a lot for ur time. On the JMS side I have the code which uses IndexWriter. I have to index the files that are getting uploaded. It's fine all the way if i upload ane file. But when i tried with 2-3 files, it giving me the following error. org.apache.lucene.store.LockObtainFa

Re: Lucene write locks

2008-07-23 Thread Michael McCandless
This looks like a CLASSPATH issue. You need to make sure whatever jar contains that class is in the CLASSPATH when you run that line. Mike Sandeep K wrote: I have another problem also. While parsing the files during indexing I get the following error, java.lang.NoClassDefFoundError: de/s

Re: Lucene write locks

2008-07-23 Thread Sandeep K
I have another problem also. While parsing the files during indexing I get the following error, java.lang.NoClassDefFoundError: de/sty/io/mimetype/MimeTypeResolver what is this? I use Lius-1.0 Its giving the error in the line where I have IndexerFactory.getIndexer(file, LiusConfig obj) plz help

Re: Lucene write locks

2008-07-23 Thread Michael McCandless
OK then this should be fine. That single machine, on receiving a JMS message, should use a single IndexWriter for making changes to the index (ie, it should not try to open a 2nd IndexWriter while a previous one is still working on a previous message). Mike Sandeep K wrote: Thanks a

Re: Lucene write locks

2008-07-23 Thread Sandeep K
Thanks a lot Mike, There will be only one machine which uses IndexWriter and its the JMS server. This server will first create the file in the physical file system(its Linux) and then index the saved file. Michael McCandless-2 wrote: > > > Sandeep K wrote: > >> >> Hi all.. >> I had a questi

Re: Lucene write locks

2008-07-23 Thread Michael McCandless
Sandeep K wrote: Hi all.. I had a question related to the write locks created by Lucene. I use Lucene 2.3.2. Will this newwer version create locks while indexing as older ones? or is there any other way that lucene handles its operations? It still creates write locks, which are used to en