5 Replies Latest reply on Mar 3, 2008 4:52 PM by Mark Little

    CommitCount is always zero

    Rasmus Moustgaard Newbie

      I have used the CommitCount attribute of the TransactionManager MBean in JBoss 4.0.2 to monitor the number of committed transactions. After upgrading to JBoss 4.2.1, however, the attribute value is always zero. Why?

      Thanks,
      Rasmus

        • 1. Re: CommitCount is always zero
          Mark Little Master

          Did you enable statistics gathering for the transaction service? It is disabled by default in 4.2.

          • 2. Re: CommitCount is always zero
            Rasmus Moustgaard Newbie

            Thank you - that was it.

            Another question: Is the TransactionCount attribute reporting the number of active transactions or is it just the sum of commited and rolled back transactions? It seems to be increasing all the time on my system.

            Thanks,
            Rasmus

            • 3. Re: CommitCount is always zero
              Jonathan Halliday Master

              TransactionCount is the total number of tx begun. Subtract the committed+aborted counts to find how many are still active.

              • 4. Re: CommitCount is always zero
                Rasmus Moustgaard Newbie

                Thanks again - I have not been able to find this documented anywhere.

                My problem now is that I would like to monitor the number of active transactions using an ThresholdMonitor MBean (see my code from JBoss 4.0.2 below), but how can I monitor something that's a difference between 3 attributes?

                Rasmus

                <!--
                 Set up Deadlock Monitor.
                 Monitors the number of active transactions.
                 If number exceeds 50 at any time, a deadlock likely exists, and an alert is triggered.
                 -->
                 <mbean code="org.jboss.monitor.ThresholdMonitor" name="jboss.monitor:service=Deadlock_Monitor">
                 <attribute name="MonitorName">Deadlock Monitor</attribute>
                 <attribute name="ObservedObject">jboss:service=TransactionManager</attribute>
                 <attribute name="ObservedAttribute">TransactionCount</attribute>
                 <depends-list optional-attribute-name="AlertListeners">
                 <depends-list-element>jboss.alerts:service=EmailAlertListener</depends-list-element>
                 </depends-list>
                 <attribute name="Threshold">50</attribute>
                 <attribute name="Period">10000</attribute>
                 <attribute name="CompareTo">-1</attribute>
                 <attribute name="Enabled">true</attribute>
                 </mbean>


                • 5. Re: CommitCount is always zero
                  Mark Little Master

                  Check the docs on TxStats. I don't recall how many of the TxStats attributes are reflected in the current MBean though.