1 Reply Latest reply on Oct 21, 2010 5:43 AM by wdfink

    hanging transaction / exhausted connections

    acurvers

      Hello, I'm maintaining an application on jboss in which the developers  decided to put business logic in the front end / jsp's and servlets etc..

      also of course to accomplish this the transactions are started and commited in the frontend..

      the problem that arrises is that if a unexpected exceptions  happens the transaction that is opened in the frontend seems (according  to log messages) to hang en never be closed.. then the what happens is  that it seems the database connection cannot be used and for some reasen  all connections to the database get exhausted almost immediately..  resulting in a application that is not functioning anymore until jboss  is restarted..

      Since its to much work now to rewrite the whole application..  What i did to overcome is, is enable the older transaction manager..(org.jboss.tm.TransactionManagerService) which has the options:

      <attribute name="InterruptThreads">true</attribute>

      and

      <!-- Force a rollback if another thread is associated with the transaction at commit -->

      <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
                       name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/>

       

      so  i hoped this would help releasing the connections or close the  transaction.. so the application would keep functioning.. but it did not  help..

      anyone has some idea's how i can fix the problem of  connections getting exhausted/ transactions not getting closed ? without  refactoring all the code to the ejb backend

       

       

       

      Caused by: javax.transaction.RollbackException: Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=inotive01/2172842, BranchQual=, localId=2172842] cannot proceed STATUS_ROLLEDBACK
          at org.jboss.resource.connectionmanager.TxConnectionManager.checkTransactionActive(TxConnectionManager.java:282)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.checkTransactionActive(BaseConnectionManager2.java:880)
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:161)
          ... 39 more
      2010-10-20 20:55:11,416 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select ......]
      com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.

        • 1. Re: hanging transaction / exhausted connections
          wdfink

          I have similar problem earlier.

          I've written a client side interceptor, was 4.2 (or earlier) and EJB2, that rollback the transaction in case of Exceptions.

          It reduce the problems but it depends to the business logic what kind of transaction must be rolled back.

          In finally the application must be handle the Exceptions correct,

          also I'm not a friend of 'alien' transaction handling because of exactly this kind of risks.