Discussions

EJB programming & troubleshooting: Transaction Problem

  1. Transaction Problem (4 messages)

    Hi,
      I am using WLServer 6.1. When i am accessing a EJB method, my transaction is timed out within 29 seconds. Can any one tell me the solution? I have already set the max. time out period in the JTA through the Admin Console and i have already try to set the time out period through the deployment description.

    Thanks,
    Atit.

    Threaded Messages (4)

  2. Transaction Problem[ Go to top ]

    Hi,

    If you are using CMP then you need to define the transaction settings in the ejb-jar.xml deployment descriptor:

        <container-transaction>
          <method>
            <ejb-name>YourBeanName</ejb-name>
            <method-name>*</method-name>
          </method>
          <trans-attribute>Required</trans-attribute>
        </container-transaction>

    As well as set the timeout in the weblogic-ejb-jar.xml deployment descriptor:

        <transaction-descriptor>
         <trans-timeout-seconds>600</trans-timeout-seconds>
        </transaction-descriptor>[/code]


    If you are using BMP then you need to define your transactions in your code yourself:

       trans = (UserTransaction) new InitialContext().lookup("javax.transaction.UserTransaction");
       trans.setTransactionTimeout(300);
       trans.begin();

    Hope that helps,

    Daniel.
  3. Transaction Problem[ Go to top ]

    Daniel,

    Do not confuse BMP (Bean Managed Persistance) with BMT (Bean Managed Transactions). You dicussed BMT not BMP.

    Now as for the timeout issue, can you be more clear about how you have your beans configured? Are these entities? If so BMP or CMP? What transaction model?

    Dave Wolf
    The Scupper Group
    dave at scuppergroup dot com
  4. Transaction Problem[ Go to top ]


    Dave's right - where I wrote BMP/CMP I meant BMT/CMT. The rest of the message is correct (I think).

    Cheers,

    Daniel.
  5. Transaction Problem[ Go to top ]

    Are you using SP3. There are some issues with transaction timeouts that I believe are solved in the latest service pack.

    David