lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Lorenzetto <cristian.lorenze...@gmail.com>
Subject ThreadLocal Transaction
Date Thu, 18 Aug 2016 08:52:42 GMT
I d like to create a class for creating a classical transaction.
Overviewing lucene api , i can see commit/rollback/prepareCommit are just
for the entire index not for partial modifications.

So i thought i could to use api writer.addIndexes as support:
when i open a transaction i could
create a temporary lucene directory ....
make all persistent operation on it.

reading operation inside transaction using a special reader using 2 indexes
(main+temporary). If i remember correctly there is in lucene this special
wrapper.
when there is a threadlocal commit i copy directory (addIndexes api) to
main directory , and i delete the temporary dir.

What do you think? can it work?
lucene api are thread safe?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message