Using the transaction service
In WebSphere Application Server, applications can use transactions to coordinate multiple updates to resources as atomic units (as indivisible units of work) such that all or none of the updates are made permanent.
In WebSphere Application Server, transactions are managed by three main components:
- A transaction manager. The transaction manager supports the enlistment of recoverable XAResources and ensures that each resource of this type is driven to a consistent outcome either at the end of a transaction or after a failure and restart of the application server.
(zos) Also, WebSphere Application Server for z/OS supports the coordination of resource managers through RRS (z/OS resource recovery services).
- A container in which the enterprise application runs. The container manages the enlistment of XAResources on behalf of the application when the application performs updates to transactional resource managers (for example, databases). Optionally, the container can control the demarcation of transactions for enterprise beans configured for container-managed transactions.
- An API, UserTransaction, that is available to bean-managed enterprise beans and servlets. These application components can use the UserTransaction interface to control the demarcation of their own transactions.
For details about the methods available with the UserTransaction interface, see the Java Transaction API (JTA) 1.1 Specification.
Also, Java Transaction API (JTA) support includes additional APIs so that application frameworks can manipulate the unit of work (UOW) context of a thread, and components can register with a JTA transaction (for example, a persistence manager can be notified of transaction completion).
Use the following tasks to work with transactions in WebSphere Application Server applications:
- Develop components to use transactions
- Configure transaction properties for an application server
- Configure transaction properties for peer recovery
- Manage manual peer recovery of the transaction service
- Manage active and prepared transactions
- Manage active and prepared transactions by
- Manage transaction logging for optimum server availability
- Interoperating transactionally between application servers
- Use WS-Transaction policy to coordinate transactions or business activities for web services
- Troubleshooting transactions
- Use one-phase and two-phase commit resources in the same transaction
- Use the ActivitySession service
Subtopics
- Transaction support in WebSphere Application Server
Support for transactions is provided by the transaction service within WebSphere Application Server. The way that applications use transactions depends on the type of application component.
- Develop components to use transactions
These topics provide information about developing WebSphere application components to use transactions
- Administer the transaction service
We can view or change settings for the transaction service and manage active and prepared transactions. We can configure transaction properties to enable peer recovery of failed application servers in a cluster. Manage transaction logging to optimize the availability of application servers.
- Transactional high availability
The high availability of the transaction service enables any server in a cluster to recover the transactional work for any other server in the same cluster. This facility forms part of the overall WebSphere Application Server high availability (HA) strategy.
- Interoperating transactionally between application servers
We can configure application servers so that transaction messages are sent and received between application servers at different versions of WAS. Depending on the version of the application server, we can set system properties, or use the transaction coordination authorization setting.
- Configure an application server to log heuristic reporting
We can configure the transaction service for an application server to indicate whether to log that the transaction service is about to commit a one-phase commit resource. This configuration is useful when you use last participant support, when there is an increased risk that a transaction has an heuristic outcome.
- (zos) Tune for applications that access CICS in z/OS
If the application accesses CICS, you might in some cases want to consider tuning the log defer interval value.
- (zos) Tune GRS when using global transactions in z/OS
WebSphere Application Server for z/OS uses global resource serialization (GRS) to communicate information between servers in a sysplex. When there are multiple servers defined in a system or a sysplex, a request might end up on the wrong server. WebSphere Application Server for z/OS uses GRS to determine where the transaction is running.
- Troubleshooting transactions
Use this overview task to help resolve a problem that you think is related to the Transaction service.
Related concepts
JTA support
Related tasks
Use the ActivitySession service Use one-phase and two-phase commit resources in the same transaction Manage active and prepared transactions Manage active and prepared transactions by Manage manual peer recovery of the transaction service Configure transaction properties for an application server Use WS-Transaction policy to coordinate transactions or business activities for web services Configure transaction properties for peer recovery
Transaction service exceptions Additional APIs Transaction service custom properties Local transaction containment
Related information:
Java Transaction API (JTA) 1.1 Specification