Repeating error: Lock obtain timed out:

We are using Hibernate ORM 4.3.11 and Search 4.3.0; hopefully that is a valid combo?

Our WLS is restarted in an orderly manner every morning at 4:30. At 5 AM, we have a scheduled EJB that triggers a background full rebuild of the indexes (only two).

Then during the day, as the users are performing work, we see this repeatedly:

org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/usr/app/class/weblogic/PRD/indexes/gov.texas.hhs.ccl.db.domain.facility.FacilityAddress/write.lock
	at org.apache.lucene.store.Lock.obtain(Lock.java:84)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:146)
	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:113)
	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:122)
	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:101)
	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
	at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.applyChangesets(SyncWorkProcessor.java:162)
	at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.run(SyncWorkProcessor.java:152)
	at java.lang.Thread.run(Thread.java:750)
> 

We’ve gone onto the server and deleted the write.lock file w/o issue but then the API cannot seem to create file at all.

OS is RHEL. The directory permission was rwxr-xr-x and is now rwxrwxr-x; no change. User running WLS is the owner.

Anyone have suggestions?

Could it be that multiple apps are trying to obtain the lock? Or the restart is not “graceful” and it does not release the lock ?

We are using Hibernate ORM 4.3.11 and Search 4.3.0; hopefully that is a valid combo?

looking at the releases page here: Releases - Hibernate Search
you probably want to go with ORM 4.3 + Search 4.5 - 5.2

Server only has one app. Shutdown uses WLS scripts to shut down and start up.

But we have added: -Dhibernate.search.default.locking_strategy = native to server env and the error appears to have been recitfied.

I stand corrected. =native did NOT solve the write.lock error.

Do we need to make sure no write.lock file exists after app server shutdown?

Does that parameter belong in the persistence unit instead of env?