[hibernate-dev] [infinispan-dev] Resetting Lucene lock at Directory initialization

Manik Surtani manik at jboss.org
Mon Oct 19 05:57:15 EDT 2009

On 19 Oct 2009, at 08:16, Emmanuel Bernard wrote:

> On the Lucene side, it seems to me that manually asking for a lock
> clear is cleaner / safer than this automagic approach.

Yeah, I agree with Emmanuel - a more explicit form would work better  
IMO.  Perhaps what you could do is something like this:

1)  Create an entry, name "sharedlock", value "address of current lock  
2)  Any time a node needs a lock, adds its addess to the "sharedlock"  
entry only if it doesn't exist (putIfAbsent)
3)  If the entry exists , check if the address is still in the cluster  
(check using CacheManager.getMembers()).  If the address doesn't exist  
(stale lock) remove and overwrite (using replace() to prevent  
concurrent overwrites)


- Manik

Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache

More information about the hibernate-dev mailing list