lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Lock handling and Lucene 1.9 / 2.0
Date Tue, 14 Sep 2004 21:12:49 GMT
Pete Lewis wrote:
> The only way to continually use the same IndexReader would be to use a
> stateful session bean (frowned upon by J2EE Container writers)

Can one implement DB connection pooling in J2EE?  This is analogous. 
One may keep a pool of IndexReaders that are reused by subsequent 
queries.  One difference is that the cache need only contain a single 
IndexReader per index, rather than a DB connection pool, which typically 
keeps multiple connections per DB.  Also, at checkout, the cache code 
should check whether a newer version of the index is available, and, if 
it is, update the cache.

If there are lots of different indexes, more than you'd like to keep 
open at once, then an LRU cache might work well, implemented e.g. with 
LinkedHashMap.  Such a cache might be a useful contribution to Lucene.

> I thought that it might be a good candidate for Lucene 2 as the FSDirectory
> code is horrible and non-J2EE compliant.

Your constructive criticism is greatly appreciated!

Have a nice day,


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

View raw message