lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin A. Burton" <>
Subject Re: verifying index integrity
Date Tue, 13 Apr 2004 00:50:43 GMT
Doug Cutting wrote:

> If you use this method, it is possible to corrupt things.  In 
> particular, if you unlock an index that another process is modifying, 
> then modify it, then these two processes might step on one another.  
> So this method should only be called when you are certain that no one 
> else is modifying the index.
We're handling this by using .pid files.  We use a standard initializer 
and use your own lock files with process IDs.  If you're on UNIX I can 
give you the source to the JNI getpid that I created.  I've been meaning 
on Open Sourcing this anyway... putting it into commons probably.

This way you can prevent multiple initialization if a java process is 
currently running that might be working with your index.  Otherwise 
there's no real way to be sure the lock isn't stale (unless time is a 
factor but that slows things down)



Please reply using PGP.    
    NewsMonster -
Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
       AIM/YIM - sfburtonator,  Web -
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
  IRC - #infoanarchy | #p2p-hackers | #newsmonster

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message