-
1. Re: InfinispanDirectory, two Cluster
sannegrinovero Jan 3, 2013 9:19 PM (in response to johnbesel)1 of 1 people found this helpfulHello,
when opening an IndexWriter on any Directory implementation is implicitly acquires an exclusive Lock.
So if you try opening an IndexWriter on both nodes at the same time, you won't corrupt the index but one of the two nodes will succeed and the other will likely see a timeout exception.
If your application doesn't open IndexWriters very often, you might have the code just try and hope for the best, eventually retrying; but it's of course better and less tricky if you can configure your application in such a way that only one of the two nodes ever attempts to write to the index.
For example Infinispan Query uses the Hibernate Search engine to delegate writes to a remote node; the options there are to use JMS or JGroups to forward needs to write to a specific node.
I'd suggest to have a look in this chapter: http://docs.jboss.org/hibernate/search/4.2/reference/en-US/html_single/#d0e652
-
2. Re: InfinispanDirectory, two Cluster
johnbesel Jan 4, 2013 3:35 AM (in response to sannegrinovero)thank you for your answer.
I think it will help me to understand what should I do as next.