1 Reply Latest reply on Oct 11, 2004 5:46 AM by Robert Szalai

    Difference in ejb-jar.xml between transaction-type "Bean" an

    thoste Newbie

      In the ejb-jar.xml I can setup a SessionBean in the tag <transaction-type> as Bean or as Container.

      But what is the difference?

        • 1. Re: Difference in ejb-jar.xml between transaction-type
          Robert Szalai Newbie

          In a BMT (Bean Managed Trandaction) you need to mark the boundaries
          of the transaction in your code.

          In a CMT (Container Managed Transaction) the EJB container (JBoss :-))
          sets the boundaries of the transactions. You can set the transaction attribute of a bean method in ejb-jar.xml:

          <assembly-descriptor>
           <container-transaction>
           <method>
           <ejb-name>SampleBean</ejb-name>
           <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
           </container-transaction>
           </assembly-descriptor>


          To learn more about BMT, CMT and transaction attributes read
          Chapter 30 of J2EE 1.4 tutorial.
          http://java.sun.com/j2ee/1.4/docs/tutorial/doc/