Subrat Mishra
Subrat Mishra

Reputation: 1

Hibernate Search: Lock held by another program: var/lucene/indexes/com.org.Recipe/write.lock

I am using hibernate search 5.5.4, while adding new record to the database this Exception occurred and the data is successfully inserted to database but the index was not created

Exception occurred org.apache.lucene.store.LockObtainFailedException: Lock held by another program: var/lucene/indexes/com.org.Recipe/write.lock

Upvotes: 0

Views: 1610

Answers (2)

Sanne
Sanne

Reputation: 6107

That literally means what the error is saying: there is another process still running which is "owning" the lock on the index.

That is very likely another instance of Hibernate Search; for example this happens if you started your application before, and didn't shut it down.

Upvotes: 1

Subrat Mishra
Subrat Mishra

Reputation: 1

Ya its solved, the problem was I tried to persists the data by session.save() when I change that to session.persist() the problem is gone the index value can update only at persist, update, delete etc.

Upvotes: 0

Related Questions