Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2511

Transaction Leak in JDBCStateManager

    XMLWordPrintable

Details

    Description

      There is a leak of Transaction objects in JDBCStateManager when the database becomes temporarily unavailable. The following steps reproduce the problem:

      1. Check the value of "TransactionCount" of the MBean jboss:service=TransactionManager, it should be 0
      2. Deploy a Message Driven Bean
      3. Stop the deployment of this bean in the JMX console under jboss.j2ee
      4. Call the MDB several times
      5. Stop the database server configured for the JDBC State Service
      6. Start the deployment of the MDB again in the JMX console
      7. Start the database server again
      8. Check the value of "TransactionCount" again, it is greater than 0 and does not go down until you restart JBoss

      The reason is that the transaction started in the constructor of JDBCStateManager$JDBCSession is not rollbacked in case no connection can be obtained from the datasource. Apparently the same bug is still in CVS head, but I have verified it only for 3.2.7.

      The following patch solves the problem for JBoss 3.2.7:

          • C:\jboss-3.2.7\messaging\src\main\org\jboss\mq\sm\jdbc\JDBCStateManager.java
          • C:\jboss-3.2.7\messaging\src\main\org\jboss\mq\sm\jdbc\JDBCStateManager.java.fixed
            ***************
          • 537,546 ****
          • 537,556 ----
            catch (Throwable ignored) { if (trace) log.trace("Unable to resume transaction " + threadTx, ignored); }

            + try
            +

            { + if (threadTx == null) + tm.rollback(); + }

            + catch (Throwable ignored)
            +

            { + if (trace) + log.trace("Unable to rollback transaction ", ignored); + }

            throw new SpyJMSException("Error creating connection to the database.", e);
            }
            }

      Attachments

        Activity

          People

            adrian.brock Adrian Brock (Inactive)
            kwinterm Karsten Wintermann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: