The prepareCommit should do most real works, so the chance index2.commit() failure should be slim.
I think it's very hard to compensate the changes already committed. One solution is that you create separate indexes for each transaction and merge them later. Merging can fail, but the transaction still fulfill ACID. -----Original Message----- From: An Hong [mailto:an.h...@i365.com] Sent: Tuesday, February 24, 2009 10:07 AM To: lucene-user Subject: IndexWriter 2-phase commit usage I'm having trouble applying IndexWriter 2-phase commit to make a transaction involving two different indexes. The scenario, 1. Open index1 2. Open index2 3. Make change1 to index1 4. Make change2 to index2 5. index1.prepareCommit() successfully flushes 6. index2.prepareCommit() successfully flushes 7. index1.commit() successfully (segmentN file written) 8. index2.commit() If step 8 fails, how can I roll back step 7 w/o implementing my own undo logic? I want to make change1 and change2 a single transaction. Thanks, An --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org