Discussions

General J2EE: weblogic.transaction.internal.TimedOutException

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

    Hi,
    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
    d=2:ec26f50035dbb4ad,Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,sec
    onds since begin=31,seconds left=30,activeThread=Thread[ExecuteThread: '13' for
    queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogi
    c.jdbc.jts.Connection]=(state=suspended,assigned=none),SCInfo[myserver]=(state=a
    ctive),properties=({weblogic.transaction.name=[EJB UserMgrBeanImpl.addUserObject
    ()], weblogic.jdbc=t3://172.24.4.97:7001}))]). 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"
            Properties="user=user;password=password;dll=ocijdbc8;protocol=thin"
            RefreshMinutes="10" Targets="myserver"
            TestConnectionsOnReserve="true" TestTableName="dual" URL="jdbc:oracle:thin:@127.0.0.1:1521:ORAINST"/>
        <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.