Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 96119 invoked from network); 11 Jul 2009 23:07:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jul 2009 23:07:39 -0000 Received: (qmail 92830 invoked by uid 500); 11 Jul 2009 23:07:49 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 92776 invoked by uid 500); 11 Jul 2009 23:07:49 -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 92767 invoked by uid 99); 11 Jul 2009 23:07:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jul 2009 23:07:48 +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; Sat, 11 Jul 2009 23:07:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3A0A023888A6; Sat, 11 Jul 2009 23:07:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r793240 - in /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core: UserTransactionImpl.java state/TimeBomb.java Date: Sat, 11 Jul 2009 23:07:26 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090711230726.3A0A023888A6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Sat Jul 11 23:07:25 2009 New Revision: 793240 URL: http://svn.apache.org/viewvc?rev=793240&view=rev Log: JCR-2207: XATest error: commit from different thread but same XID must not block Increase the block detection timeout. Use Thread.join(long) instead of the more complicated TimeBomb mechanism. Removed: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/TimeBomb.java Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserTransactionImpl.java Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserTransactionImpl.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserTransactionImpl.java?rev=793240&r1=793239&r2=793240&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserTransactionImpl.java (original) +++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/UserTransactionImpl.java Sat Jul 11 23:07:25 2009 @@ -29,7 +29,6 @@ import javax.jcr.Session; import org.apache.jackrabbit.api.XASession; -import org.apache.jackrabbit.core.state.TimeBomb; /** * Internal {@link javax.transaction.UserTransaction} implementation. @@ -124,27 +123,20 @@ status = Status.STATUS_COMMITTING; if (distributedThreadAccess) { try { - final Thread t = Thread.currentThread(); - final TimeBomb tb = new TimeBomb(100) { - public void explode() { - t.interrupt(); - } - }; - tb.arm(); Thread distributedThread = new Thread() { public void run() { try { xares.commit(xid, false); - tb.disarm(); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } } }; distributedThread.start(); - Thread.sleep(200); + distributedThread.join(1000); } catch (InterruptedException e) { - throw new SystemException("commit from different thread but same XID must not block"); + throw new SystemException( + "Commit from different thread but same XID must not block"); } } else { xares.commit(xid, false);