Possible Bug in JBoss Transaction Management
boo Oct 15, 2004 2:39 AMHi,
I hope this is the right place to post a (possible) bug report.
I might have found a serious (but rarely arising) bug in JBoss (3 + 4) transaction management.
This is the Scenario:
NSession (statless, remote) has a method with the following signature:
public void foo( scribble.server.ejb.interfaces.OuterObject.InnerObject param)
The class InnerObject is a static inner class of OuterObject as follows:
package scribble.server.ejb.interfaces; import java.io.Serializable; public class OuterObject implements Serializable { public static class InnerObject implements Serializable { public String name; public InnerObject( String name) { this.name = name; } } }
SessionBean 'NSession' has the following transaction attributes (from ejb-jar.xml):
<container-transaction > <method > <ejb-name>NSession</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> <container-transaction > <method > <ejb-name>NSession</ejb-name> <method-intf>Remote</method-intf> <method-name>foo</method-name> <method-params> <method-param>scribble.server.ejb.interfaces.OuterObject.InnerObject</method-param> </method-params> </method> <trans-attribute>Never</trans-attribute> </container-transaction>
When calling the method 'NSession.foo' within a transactional context (e.g. from a Client with a UserTransaction), I expect a 'Transaction not allowed'-Exception, since 'foo' is attributed as 'Never', but I get none. Instead of that the method is being executed as if it was attributed as 'Required'.
I did not look into the JBoss source, but I have a guess: it seems that JBoss has problems (while reading the ejb-jar.xml) to separate the package name from the full-qualified classname of an inner class correctly when occuring as a method parameter, e.g.
scribble.server.ejb.interfaces.OuterObject.InnerObject {------------package-----------------------|--class----} WRONG
instead of
scribble.server.ejb.interfaces.OuterObject.InnerObject {------------package-----------|---------class---------} CORRECT
and therefore can not assign the transaction attribute 'Never' to the method 'foo'. Instead the method gets the 'Required' attribute, since it matches the wildcard '*'.
Regards,
Boo