//index the temporary document
final DOMIndexer indexer = new DOMIndexer(this, transaction, doc, targetDoc); //NULL transaction, so temporary fragment is not journalled - AR
indexer.scan();
indexer.store();
//store the temporary document
temp.addDocument(transaction, this, targetDoc); //NULL transaction, so temporary fragment is not journalled - AR
// unlock the temp collection
if(transaction == null) {
temp.getLock().release(Lock.WRITE_LOCK);
} else if(!created) {
transaction.registerLock(temp.getLock(), Lock.WRITE_LOCK);