We are working on a JavaFX solution using Hibernate/JPA to access the database. We use Hibernate Search with Lucene to search for entities, which works quite well, as long as only one instance of the program is running. If a second instance is started, the search still works, but updating the entities fails, because the first started application keeps the write lock on the index. We are not using any kind of JavaEE application server, the JavaFX client accesses the database directly via Hibernate.
In the final productive environment there will be one MS-SQL server holding all the data and several rich clients running on the server in virtual machines or reaching the database server via VPN. I would like to enable that all clients can add and edit entities and get the index updates immediately. I already tried to find a solution with Infinispan, but didn’t really grasp where to start and what to do exactly.
Can anyone give me an idea on how to accomplish this? Is it possible to save the indexes directly in the database or start some kind of service where the clients can access the current index?