Chapter 5. Web Service Transaction service management

The basic building blocks of a transactional Web Services application are:
  • the application itself
  • the Web services that the application consumes
  • the Transaction Manager
  • the transaction participants which support those Web services
In a typical deployment, a single developer is not likely to support all of these roles. An overview is presented because developers often produce services, or applications that consume services, while system administrators run the transaction-management infrastructure.

5.1. The Transaction Manager

The transaction manager is a Web service which coordinates JBoss Transaction Service transactions. It is the only software component in the JBoss Transaction Service that is meant to be run directly as a network service, instead of supporting end-user code. The transaction manager runs as a JAXM request/response Web service.

Important

When starting up an application server instance that has JBoss Transaction Service deployed within it, you may see various error messages in the console or log. Here is one such message:
16:53:38,850 ERROR [STDERR] Message Listener Service: started, message listener jndi name activationcoordinator
Messages like these are for information purposes, not actual errors.

5.1.1. Configuring the Transaction Manager

The Transaction Manager and related infrastructure are configured by means of properties files:
  • wscf.xml
  • wst.xml
  • wstx.xml
These files are located in the conf directory and are used to configure the demo application and the standalone module.
For the most part, the default values in these files do not need to be altered. However, the com.arjuna.ats.arjuna.objectstore.objectStoreDir property determines the location of the persistent store used to record transaction state. The default value of C:/temp/ObjectStore should be changed to a value appropriate to your system. In a production environment, this directory should be located on fault-tolerant media, such as a RAID array.
When a standalone coordinator is being used by an application, you must enable and modify two additional properties in the wstx.xml file:
  • com.arjuna.mw.wst.coordinatorURL
  • com.arjuna.mw.wst.terminatorURL
These properties represent the URLs used by the client application to contact the standalone coordinator. They should be configured with the correct host name and port of the standalone coordinator.

Note

JBoss Transaction Service is highly modular. In order to allow for flexible deployment of individual components, the same property values are sometimes needed in more than one configuration file. For the majority of configurations, you should maintain consistent values for properties that are defined in more than one file.

5.1.2. Deploying the Transaction Manager

The Web Service Transaction Manager component of the Transaction Service consists of a number of JAR files which contain the application’s class files, as well as Web service (WAR) files which expose the necessary services. Programmers include all these components in their application EAR file during application development, to simplify deployment of the transaction infrastructure. In production, you can install the Transaction Manager as a stand-alone application, to centralize configuration and management at the server level. The demonstration application shipped with JBoss Transaction Server includes a sample deployment descriptor which includes the Transaction Manager components in an application.
JBoss Transaction Service uses fixed endpoints for its underlying protocol communication. Therefore, problems may arise if multiple applications using the Transaction Service are deployed to the same server concurrently. To deploy several transactional applications in the same server, deploy the Transaction Manager as a separate application, rather than embedding it within the deployment of individual applications.
The coordinator directory in the JBoss Transaction Service installation assists in the configuration and deployment of a stand-alone transaction manager. In order to use this, you must:
  • Have JBoss Enterprise Application Platform 5 installed
  • Install ant 1.4 or later.

Important

The application server installation must be different from the one that clients and services are deployed into. Otherwise, conflicts may occur between the various JBoss Transaction Service components.
Edit the build.xml included with the coordinator, so that it points to the application server installation where the transaction coordinator will be deployed, and the location of the JBoss Transaction Service installation. The files ws-c_jaxm_web-app.xml and ws-t_jaxm_web-app.xml in the dd/ directory of the coordinator are the deployment descriptors for the WS-C and WS-T WAR files. They contain templated URLs. During the build phase, ant substitutes the hostname and port values from the build.xml into these files.
Run ant, with target deploy-weblogic, deploy-jboss or deploy-webmethods, to create and deploy a new coordinator into the correct application server installation.
Next, point your client at the required coordinator, by generating the demo application and specifying the port and hostname of the coordinator.

5.1.3. Deployment descriptors

It is not generally necessary to change the contents of the various deployment descriptors used by JBoss Transaction Service. However, if you do need to modify them they are all included in the coordinator module.
Not all JBoss Transaction Service components have ready access to the information in the deployment descriptors. Therefore, if you modify the JNDI names used by any of the WS-C or WS-T deployment descriptors, you may need to inform other JBoss Transaction Service components at run-time, by setting an appropriate property in the wstx.xml configuration file.
The Table 5.1, “Deployment descriptor values and properties” table shows the default JNDI names used by the deployment descriptors and the corresponding property to set if the default value is changed.

Table 5.1. Deployment descriptor values and properties

JNDI Name Property
Activationrequester com.arjuna.mw.wst.at.activationrequester
Activationcoordinator com.arjuna.mw.wst.at.activationcoordinator
Completionparticipant com.arjuna.mw.wst.at.completionparticipant
Registrationrequester com.arjuna.mw.wst.at.registrationrequester
durable2pcdispatcher com.arjuna.mw.wst.at.durable2pcdispatcher
durable2pcparticipant com.arjuna.mw.wst.at.durable2pcparticipant
volatile2pcdispatcher com.arjuna.mw.wst.at.volatile2pcdispatcher
volatile2pcparticipant com.arjuna.mw.wst.at.volatile2pcparticipant
businessagreementwithparticipantcompletiondispatcher com.arjuna.mw.wst.ba.businessagreementwpcdispatcher
businessagreementwithparticipantcompletionparticipant com.arjuna.mw.wst.ba.businessagreementwpcparticipant
businessagreementwithcoordinatorcompletiondispatcher com.arjuna.mw.wst.ba.businessagreementwccdispatcher
businessagreementwithcoordinatorcompletionparticipant com.arjuna.mw.wst.ba.businessagreementwccparticipant