2 Replies Latest reply: May 13, 2008 10:53 AM by 666705 RSS

    Default <trans-attribute> Value

    3004

      I was wondering how WLS handles a transaction on a CMT EJB session bean that does
      not have <trans-attrbute> defined for it.

      For example, I have the following entry in ejb-jar.xml:

      <session>
      <ejb-name>MyBean</ejb-name>
      <home>com.x.catalog.ejb.MyBeanHome</home>
      <remote>com.x.catalog.ejb.MyBean</remote>
      <ejb-class>com.x.catalog.ejb.MyBeanEJB</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <resource-ref>
      <description></description>
      <res-ref-name>jdbc/XXXWebDataSource</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </session>

      However, there is no <container-transaction> in the <assembly-descriptor> portion
      of the deployment descriptor file. I assume that the "default" transaction type
      is "Supports", but could find no documentation to tell me that. I looked in the
      EJB Specification, but did not see an answer there. Perhaps it is left up to the
      vendor, such as WL. I was expecting WL to throw an exception about this in EJBC,
      but it did not. I just started a new job and was surprised to see that they have
      their EJBs defined this way -- I've not experienced this before. Apparently this
      declaration has been working for them for some time. They are using WLS 7.0.2.

      If anyone has any insight into this, especially definitive documentation that
      states how this case is handled, please let me know.
        • 1. Re: Default <trans-attribute> Value
          3004

          'Supports' is the default <trans-attribute> value in WebLogic Server.

          thanks,
          Deepak Vohra


          "Aidan" <noemail@noemail.com> wrote:
          >
          I was wondering how WLS handles a transaction on a CMT EJB session bean
          that does
          not have <trans-attrbute> defined for it.

          For example, I have the following entry in ejb-jar.xml:

          <session>
          <ejb-name>MyBean</ejb-name>
          <home>com.x.catalog.ejb.MyBeanHome</home>
          <remote>com.x.catalog.ejb.MyBean</remote>
          <ejb-class>com.x.catalog.ejb.MyBeanEJB</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
          <resource-ref>
          <description></description>
          <res-ref-name>jdbc/XXXWebDataSource</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>
          </session>

          However, there is no <container-transaction> in the <assembly-descriptor>
          portion
          of the deployment descriptor file. I assume that the "default" transaction
          type
          is "Supports", but could find no documentation to tell me that. I looked
          in the
          EJB Specification, but did not see an answer there. Perhaps it is left
          up to the
          vendor, such as WL. I was expecting WL to throw an exception about this
          in EJBC,
          but it did not. I just started a new job and was surprised to see that
          they have
          their EJBs defined this way -- I've not experienced this before. Apparently
          this
          declaration has been working for them for some time. They are using WLS
          7.0.2.

          If anyone has any insight into this, especially definitive documentation
          that
          states how this case is handled, please let me know.
          • 2. Re: Default <trans-attribute> Value
            666705
            hi,

            we have recently migrated from weblogic 6.1 sp4 to weblogic 8.1sp6. There are few methods in our ejb that does not have trans-attribute set in ejb-jar.xml(for eg. if the ejb has 10 methods, only 6 methods have trans-attribute set in ejb-jar.xml and the remaining 4 method does not have trans-attribute).

            Could any one tell how weblogic 6.1 handles(type of trans-attribute) if any method does not have trans-attribute in ejb-jar.xml?

            I would also like to know if the default behaviour has been changed from weblogic 6.1 to weblogic 8.1.

            Thanks
            Srini