jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r885411 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Date Mon, 30 Nov 2009 13:06:34 GMT
Author: mreutegg
Date: Mon Nov 30 13:06:33 2009
New Revision: 885411

URL: http://svn.apache.org/viewvc?rev=885411&view=rev
Log:
JCR-2413: AlreadyClosedException on initial index creation

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=885411&r1=885410&r2=885411&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Mon Nov 30 13:06:33 2009
@@ -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,11 +1293,13 @@
 
             try {
                 if (transactionPresent) {
-                    for (NodeId id : finished.keySet()) {
-                        executeAndLog(new DeleteNode(getTransactionId(), id));
-                    }
-                    for (Document document : finished.values()) {
-                        executeAndLog(new AddNode(getTransactionId(), document));
+                    synchronized (this) {
+                        for (NodeId id : finished.keySet()) {
+                            executeAndLog(new DeleteNode(getTransactionId(), id));
+                        }
+                        for (Document document : finished.values()) {
+                            executeAndLog(new AddNode(getTransactionId(), document));
+                        }
                     }
                 } else {
                     update(finished.keySet(), finished.values());



Mime
View raw message