tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
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 GMT
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"));
                 }
             }



Mime
View raw message