[hibernate-dev] [Search] Lazy initialization vs HSearch - Round 4

Guillaume Smet guillaume.smet at gmail.com
Mon Dec 10 15:45:55 EST 2012


On Mon, Dec 10, 2012 at 9:07 PM, Guillaume Smet
<guillaume.smet at gmail.com> wrote:
> On Mon, Dec 10, 2012 at 8:27 PM, Guillaume Smet
> <guillaume.smet at gmail.com> wrote:
>> Is it transactionally safe?
>
> From what I read, it's not.
>
> Do you see any way to get this type of pattern working in a
> transactionally safe way?

Hmmm, just handwaving at the moment but couldn't we imagine that,
instead of flushing to the indexes, we could flush to a "buffer" of
Lucene documents. I think it could reduce the memory footprint
compared to keeping all the entities in memory while allowing us to
keep the operation transactional? And it might allow us to get the
above case working.

Perhaps, flushing to a queue of Lucene documents isn't the right idea
but we could prepare/"compile" the LuceneWork to whatever is
convenient for this particular operation (Lucene document, query for
deletion...), get rid of the entity and all the entity related stuff
and apply the works at the commit of the transaction as it's already
done.

I'm pretty sure it could be an interesting compromise - if doable.

Any thoughts?

-- 
Guillaume


More information about the hibernate-dev mailing list