Index: src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java =================================================================== --- src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java (revision 885369) +++ src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java (working copy) @@ -329,7 +329,7 @@ flushTask = new Timer.Task() { public void run() { // check if there are any indexing jobs finished - checkIndexingQueue(); + checkIndexingQueue(false); // check if volatile index should be flushed checkFlush(); } @@ -1266,17 +1266,6 @@ /** * Checks the indexing queue for finished text extrator jobs and updates the - * index accordingly if there are any new ones. This method is synchronized - * and should only be called by the timer task that periodically checks if - * there are documents ready in the indexing queue. A new transaction is - * used when documents are transfered from the indexing queue to the index. - */ - private synchronized void checkIndexingQueue() { - checkIndexingQueue(false); - } - - /** - * Checks the indexing queue for finished text extrator jobs and updates the * index accordingly if there are any new ones. * * @param transactionPresent whether a transaction is in progress and the @@ -1304,12 +1293,14 @@ try { if (transactionPresent) { - for (NodeId id : finished.keySet()) { - executeAndLog(new DeleteNode(getTransactionId(), id)); + synchronized (this) { + for (NodeId id : finished.keySet()) { + executeAndLog(new DeleteNode(getTransactionId(), id)); + } + for (Document document : finished.values()) { + executeAndLog(new AddNode(getTransactionId(), document)); + } } - for (Document document : finished.values()) { - executeAndLog(new AddNode(getTransactionId(), document)); - } } else { update(finished.keySet(), finished.values()); }