| Hi Debashish Bharali, version 4.x of Hibernate Search is no longer maintained so such a topic is better addressed in a forum. Also, it's not a bug but a configuration mistake so I'll close it. Lucene indexes are getting "locked" when they are written to in exclusive mode, so to protect them against multiple writers corrupting the index. So normally you should have only strictly one instance of Hibernate Search using one index path; the default is to not allow this, exactly to prevent issues like you are reporting. The `exclusive_index_use` being set to false is an explicit request to disable this safety, but you should strictly only use this when your application can guarantee that no writes are ever going to be triggered on the index from both applications. Clearly you describe a scenario in which both applications are concurrenctly attempting to write on the same index, and that's why you get Unable to acquire lock exceptions. You have various options:
- Change your application so that only one cluster makes writes to the index
- Do not use clustering but deploy both applications to use the same Hibernate Search instance
- Let one Hibernate Search instance delegate the write operations ot the other one
This last solution is what is explained in the manual in this section:
For the older version:
Please read the related chapters on architecture as well, so that you can make an informed choice depending on your needs. |