General J2EE: weblogic.transaction.internal.TimedOutException

  1. weblogic.transaction.internal.TimedOutException (2 messages)

    I have a piece of code as below in a DAO which is called by
    a stateless bean UserMgrBean:

    Get Connection from TxDataSource;
    while enumeration has more elements
       For the enumeration entry, Insert row into table T1;
    Close Connection;

    The problem I am facing is when the enumeration has like 20000 entries, obviously the while loop lasts more than 30 seconds and hence my bean fails with following server log:

    ....... .. Exception Message - The transaction is no longer active
     (status = Marked rollback. [Reason = weblogic.transaction.internal.TimedOutException: Transaction timed out after 31seconds
    tx = transaction=(IdHash=5834535,Name = [EJB UserMgrBeanImpl.addUserObject()],Xi
    onds since begin=31,seconds left=30,activeThread=Thread[ExecuteThread: '13' for
    queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogi
    ctive),properties=({weblogic.transaction.name=[EJB UserMgrBeanImpl.addUserObject
    ()], weblogic.jdbc=t3://}))]). No further JDBC access is allowed
      within this transaction.

    Does Anyone know how to overcome this problem.
  2. I am using WLServer 6.0 and the config.xml for Connection pool and Tx Datasource are as follows:

        <JDBCConnectionPool CapacityIncrement="5"
            DriverName="oracle.jdbc.driver.OracleDriver" InitialCapacity="5"
            MaxCapacity="100" Name="demopool"
            RefreshMinutes="10" Targets="myserver"
            TestConnectionsOnReserve="true" TestTableName="dual" URL="jdbc:oracle:thin:@"/>
        <Application Deployed="true" Name="certificate" Path=".\config\mydomain\applications">

        <JDBCTxDataSource EnableTwoPhaseCommit="false"
            JNDIName="jdbc.MyTxDB" Name="MyTxDB" PoolName="demopool" Targets="myserver"/>
  3. I'm not sure about WLS 6.0, but in WLS 6.1, in the config.xml, there is a JTA element with a property named TimeoutSeconds. This is defaulted to 30. You may want to increase this to suite your needs.

    config.xml is described in detail in the WebLogic Server Configuration Reference.