Return-Path: Delivered-To: apmail-openejb-commits-archive@www.apache.org Received: (qmail 839 invoked from network); 18 Jan 2009 07:28:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jan 2009 07:28:47 -0000 Received: (qmail 49767 invoked by uid 500); 18 Jan 2009 07:28:47 -0000 Delivered-To: apmail-openejb-commits-archive@openejb.apache.org Received: (qmail 49751 invoked by uid 500); 18 Jan 2009 07:28:47 -0000 Mailing-List: contact commits-help@openejb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openejb.apache.org Delivered-To: mailing list commits@openejb.apache.org Received: (qmail 49742 invoked by uid 99); 18 Jan 2009 07:28:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Jan 2009 23:28:47 -0800 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; Sun, 18 Jan 2009 07:28:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1D1082388986; Sat, 17 Jan 2009 23:28:24 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r735394 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Date: Sun, 18 Jan 2009 07:28:23 -0000 To: commits@openejb.apache.org From: dblevins@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090118072824.1D1082388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dblevins Date: Sat Jan 17 23:28:23 2009 New Revision: 735394 URL: http://svn.apache.org/viewvc?rev=735394&view=rev Log: Workaround for a TCK test that needs to be challenged. According to EJB 3.0 "4.4.4 Restrictions for Transactions" any remove methods from home or component interfaces must not be allowed if the bean instance is in a transaction. Unfortunately, the Java EE 5 TCK expects has tests that ignore the restrictions in 4.4.4 and expect beans in transactions can be removed via their home or component interface. The test to see if the bean instance implements javax.ejb.SessionBean is a workaround for passing the TCK while the tests in question can be challenged or the spec can be changed/updated. Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java?rev=735394&r1=735393&r2=735394&view=diff ============================================================================== --- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java (original) +++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Sat Jan 17 23:28:23 2009 @@ -352,7 +352,17 @@ InterfaceType interfaceType = deploymentInfo.getInterfaceType(callInterface); if (interfaceType.isComponent()) { Instance instance = checkedOutInstances.get(primKey); - if (instance != null) { + + /** + * According to EJB 3.0 "4.4.4 Restrictions for Transactions" any remove methods + * from home or component interfaces must not be allowed if the bean instance is + * in a transaction. Unfortunately, the Java EE 5 TCK has tests that ignore the + * restrictions in 4.4.4 and expect beans in transactions can be removed via their + * home or component interface. The test to see if the bean instance implements + * javax.ejb.SessionBean is a workaround for passing the TCK while the tests in + * question can be challenged or the spec can be changed/updated. + */ + if (instance != null && instance.bean instanceof javax.ejb.SessionBean) { throw new ApplicationException(new RemoveException("A stateful EJB enrolled in a transaction can not be removed")); } }