Product SiteDocumentation Site

Chapter 8. Using JBossJTA in Application Servers

8.1. JBoss Application Server

8.1. JBoss Application Server

Service Configuration
The JBoss Transaction Service is configured primarily via the XML files stored in the etc directory, but when run as a JBOSS service there are a number of configurable attributes available. They are as follows:
  • TransactionTimeout – The default transaction timeout to be used for new transactions. Specified as an integer in seconds.
  • StatisticsEnabled – This determines whether or not the transaction service should gather statistical information. This information can then be viewed using the PerformanceStatistics MBean. Specified as a Boolean. The default is to not gather this information.
  • PropagateFullContext – This determines whether a full transactional context is propagated by context importer/exporter. If set to false only the current transaction context is propagated. If set to true the full transaction context (including parent transactions) is propagated.
These attributes are specified as MBean attributes in the jboss-service.xml file located in the server/all/conf directory, for example:
<mbean code="com.arjuna.ats.jbossatx.jts.TransactionManagerService" name="jboss:service=TransactionManager">
		
<attribute name="TransactionTimeout">300</attribute>
<attribute name="StatisticsEnabled>true</attribute>>
		
</mbean>
The transaction service is configurable also via the standard JBoss Transaction Service property files. These are located in the JBossTS install location under the etc sub-directory.
These files can be edited manually or through JMX. Each property file is exposed via an object with the name com.arjuna.ts.properties and an attribute of module where module is equal to the name of the module to be configured, for example, com.arjuna.ts.properties:module=arjuna.
Logging
In order to make JBossTS logging semantically consistent with JBossAS, the TransactionManagerService modifies the level of some log messages. This is achieved by overriding the value of the com.arjuna.common.util.logger property given in the jbossjta-properties.xml file. Therefore, the value of this property will have no effect on the logging behaviour when running embedded in JBossAS. By forcing use of the log4j_releveler logger, the TransactionManagerService causes all INFO level messages in the transaction code to be modified to behave as DEBUG messages. Therefore, these messages will not appear in log files if the filter level is INFO. All other log messages behave as normal.
The services
There is currently one service offered by the JBOSS integration called TransactionManagerService. Here we shall discuss what this service does.
The transaction manager service’s main purpose is to ensure the recovery manager is started. It also binds the JBossTS JTA transaction manager to java:/TransactionManager name with the JNDI provider. This service depends upon the existence of the CORBA ORB Service and it must be using JacORB as the underlying ORB implementation.
There are two instances of this service:
  • distributed: this uses the JTS enabled transaction manager implementation and hence supports distributed transactions and recovery. To configure this use the com.arjuna.ats.jbossatx.jts.TransactionManagerService class. This is the default configuration.
  • local: this uses the purely local JTA implementation. To configure this use the com.arjuna.ats.jbossatx.jta.TransactionManagerService class.
Ensuring Transactional Context is Propagated to the Server
It is possible to coordinate transactions from a coordinator which is not located within the JBoss server (e.g. using transactions created by an external OTS server). To ensure the transaction context is propagated via JRMP invocations to the server, the transaction propagation context factory needs to be explicitly set for the JRMP invoker proxy. This is done as follows:
JRMPInvokerProxy.setTPCFactory( new com.arjuna.ats.internal.jbossatx.jts.PropagationContextManager() );