Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 50876 invoked from network); 30 Nov 2009 13:06:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Nov 2009 13:06:58 -0000 Received: (qmail 37609 invoked by uid 500); 30 Nov 2009 13:06:58 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 37517 invoked by uid 500); 30 Nov 2009 13:06:57 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 37508 invoked by uid 99); 30 Nov 2009 13:06:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2009 13:06:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Nov 2009 13:06:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1BB50238888E; Mon, 30 Nov 2009 13:06:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: mreutegg@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091130130634.1BB50238888E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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());