JTA module

This module aims to monitor commits/rollbacks and active transaction number.


sirona-jta should be added to your webapp. You need to register the jta gauges. To do it the easiest is to add sirona-web to your webapp and register the listener org.apache.sirona.web.discovery.GaugeDiscoveryListener:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

Note: you can register it manually using org.apache.sirona.gauges.Gauge$LoaderHelper or org.apache.sirona.repositories.Repository#addGauge. Note 2: in a servlet 3 container it is done automatically if org.apache.sirona.web.activated is true (by default)

Then you need to add on the beans which can be enrolled in transactions you want to monitor the annotation org.apache.sirona.jta.JTAMonitored (CDI beans) or the interceptor org.apache.sirona.jta.JTAInterceptor (for EJB for instance it can be done through configuration, see ejb-jar.xml).

To configure it and not modify your code you can use the cdi module and just add the jta in the list of values:

You can configure it (without adding the @JTAMonitored annotation) using org.apache.sirona.cdi.jta key and listing predicates as values (see CDI for details). This feature needs cdi module.

For instance:

org.apache.sirona.cdi.jta = prefix:org.superbiz.MyService,regex:.*Bean