Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 72748 invoked from network); 8 Mar 2006 22:43:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Mar 2006 22:43:03 -0000 Received: (qmail 30730 invoked by uid 500); 8 Mar 2006 22:43:03 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 30718 invoked by uid 99); 8 Mar 2006 22:43:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 14:43:02 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 14:43:02 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax (Postfix) with ESMTP id 4B39DD49FA for ; Wed, 8 Mar 2006 22:42:41 +0000 (GMT) Message-ID: <1393675320.1141857761304.JavaMail.jira@ajax> Date: Wed, 8 Mar 2006 22:42:41 +0000 (GMT) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-238) Timing bug in TCK test case ThreadSafe In-Reply-To: <1732359610.1134124448353.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/JDO-238?page=comments#action_12369558 ] Craig Russell commented on JDO-238: ----------------------------------- Looks good. A few comments. 1. The thread count of 2 doesn't seem to be much of a test. How about 14 or so? 2. The use of a local pmf should be restricted to where you need more than the single PMF that most tests use. Rather, the pmf defined in JDO_Test can be accessed directly without hiding it by the local pmf. 3. The use of testXXX should be avoided as testXXX methods are special cases for JUnit. Suggest calling the testConcurrent something like runConcurrentThreads. > Timing bug in TCK test case ThreadSafe > -------------------------------------- > > Key: JDO-238 > URL: http://issues.apache.org/jira/browse/JDO-238 > Project: JDO > Type: Bug > Components: tck11, tck20 > Versions: JDO 2 beta > Reporter: Michael Bouschen > Assignee: Martin Zaun > Priority: Minor > Fix For: JDO 2 final > Attachments: ThreadSafe.java, ThreadSafe.java.diff > > The TCK test ThreadSafe runs multiple threads, where each thread tries to persist the same pc instance using its own PM. The expected behavior is that one thread succeeds persisting the pc instance and stores it at transaction commit. All other threads should result in a JDOException because the pc instance is already bound to a different PM. All threads close the PM at the end. > Now, it might happen that the succeeding thread closes the PM before a parallel thread tries to persist the pc instance. The behavior of pm.makePersistence for a pc instance bound to a closed pm is not specified, so it does not necessarily result in an exception. > The test case should be changed such that the succeeding thread waits for all the other threads before closing the PM. Please note, the solution must be robust enough to avoid a deadlock situation even if an erroneous JDO implementation would allow multiple threads to succeed persisting the pc instance. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira