2 Replies Latest reply on Jan 19, 2006 3:49 PM by chetanagg

    SessionBean with method transaction type

    dirk.koehler

      Hi everybody,

      I have a problem with TX handling of CMT in particular with "RequiresNew" types:

      Following scenario:

      I have a session bean here where all remote interface methods are declared with an transaction type "Required" - means per definition all method calls to it will open transactions.

      From this bean I call another Session bean method (different bean) declared with TX type "RequiresNew" (I verified via ejb-jar.xml as well)

      We introduced this behavior to workaround a DB deadlock.

      The Problem: I still see that this "inner" call does not commit any database changes after returning to the caller bean and the same outter transaction (verified via TX-ID) is used during processing the "RequiresNew" call -

      How can this be... a new transaction is supposed to be started and the current one to be suspended (which will be resumed after the "inner" TX was commited).

      Hope somebody experienced the same issue or is using "RequiresNew" so (s)he could point me to a solution.
      Did I miss anything or is JBoss behaving not according to the definition of RequiresNew (http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/transactions/transactions7.html)?


      Thanks,

      Dirk

        • 1. Re: SessionBean with method transaction type
          dirk.koehler

          I finally found the problem after debugging JBoss:

          the deployment descriptor (ejb-jar.xml) generated by xdoclet v1.2.3 spit out a method signature with a param of an inner class which had an incorrect format of "CLASS.INNERCLASS" insteand of "CLASS$INNERCLASS"

          This is why JBoss ignored the TX type defined in the Bean itself since it checks for method signature by string comparison...

          just filed a bug for the xdoclet guys (http://opensource2.atlassian.com/projects/xdoclet/browse/XDT-1575)

          thanks to everybody who was looking into this...

          ps.: the workaround would be "not generating the ejb-jar.xml" for packaging or refactoring your method signature :-(

          • 2. Re: SessionBean with method transaction type
            chetanagg

            Hi

            I have the similar problem..

            The another bean's method with RequiresNew attribute never commits. We are using some JDBC updates inside RequiresNew method.

            Can you please suggest me some workaround??
            have i missed some configuration?

            Thanks
            Chetan