lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Brown <...@us.ibm.com>
Subject Lock error attempting update of RAMDirectory index
Date Thu, 31 Aug 2006 22:24:00 GMT

I'm getting the following error trying to instantiate an IndexModifier on a
RAMDirectory index:

java.io.IOException: Lock obtain timed out:
org.apache.lucene.store.RAMDirectory$1@a336b7
	at org.apache.lucene.store.Lock.obtain(Lock.java(Compiled Code))
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:254)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:244)
	at org.apache.lucene.index.IndexModifier.init(IndexModifier.java:148)
	at org.apache.lucene.index.IndexModifier.<init>(IndexModifier.java:111)
...

Here's some background:

I have a web application where, upon startup, this RAMDirectory is created
and loaded with a set of values from 2 databases.  When a user makes a call
to do a delete or add of data, it should update not only the database
(obviously) but also the RAMDirectory index, such that the 2 are always in
sync with one another.  

It was my thought to have a static class which calls an update method on
itself every X number of minutes to recreate/reload the RAMDirectory index
from the database -- this in addition to the simultaneous updates to
RAMDirectory (removal of documents and adding of documents) and database to
keep the data in sync.  Then, I should be able to just use searching
capabilities that Lucene offers to get the data requested by the user,
rather than issuing tons of select queries to the databases.  

What is causing this error, and how do I fix?  What would be a good approach
for achieving the goal of database and index synchronization?

Thanks in advance,

Philip
-- 
View this message in context: http://www.nabble.com/Lock-error-attempting-update-of-RAMDirectory-index-tf2199620.html#a6089447
Sent from the Lucene - Java Users forum at Nabble.com.


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


Mime
View raw message