background preloader

Transaction

Facebook Twitter

Configuring and using XA distributed transactions in WebSphere Studio. What are distributed transactions? Before diving into how to develop applications using distributed transactions, let's review what distributed transactions are and why they're useful. Several terms are often used interchangeably: transaction, distributed transaction, two-phase commit, XA transaction, transaction propagation, and CORBA OTS transaction. But these terms actually have different meanings: Transaction -- a series of actions performed as a single logical unit of work in which either all of the actions are performed or none of them are (also called a local or simple transaction). A transaction is often described as ACID -- atomic, consistent, isolated, and durable. Distributed transaction -- An ACID transaction between two or more independent transactional resources (for example, two separate databases). This diagram form the XA specification shows the parts of a distributed transaction: X/Open Distributed Transaction Processing (DTP) model Object Transaction Service (OTS) Model.

Configuring and using XA transactions with WebSphere MQ V6 Classes for Java. Introduction The XA specification defines how applications use a transaction manager to coordinate a distributed transaction across multiple resource managers. Distributed transactions enable independent resources such as IBM® WebSphere® MQ and DB2® Universal Database to participate in a single unit of work that assures data integrity, even if one resource cannot commit or crashes while the transaction is in progress. A transaction will commit only if all resources can commit successfully -- otherwise it is rolled back. WebSphere MQ provides support for XA distributed transactions, and WebSphere MQ Classes for Java™ let Java applications use WebSphere MQ to coordinate transactions involving DB2 and Oracle® databases. Database updates may be coordinated with messaging applications, with the transaction being committed only if both operations succeed.

Configuration of WebSphere MQ for JDBC/XA transactions is straightforward, but requires a number of steps. Supported platforms and databases. XA Transactions. Opengroup. Understanding JTA—the Java Transaction API. Forums : JMS, JPA, XA, rollback and all the rest ... Chapter 4. Transactions on JBoss. Chapter 4. Transactions on JBoss The JTA Transaction Service This chapter discusses transaction management in JBoss and the JBossTX architecture. The JBossTX architecture allows for any Java Transaction API (JTA) transaction manager implementation to be used.

JBossTX includes a fast in-VM implementation of a JTA compatible transaction manager that is used as the default transaction manager. 4.1. For the purpose of this discussion, we can define a transaction as a unit of work containing one or more operations involving one or more shared resources having ACID properties.

Atomicity: A transaction must be atomic. To illustrate these concepts, consider a simple banking account application. The atomicity property means that both the withdrawal and deposit is performed as an indivisible unit. The consistency property means that after the transaction, the sum of the amounts of all accounts must still be 0. The durability property is also important. 4.1.1. 4.1.2. 4.1.3. 4.1.4. 4.1.5. 4.2. Transaction management under J2EE 1.2. A transaction can be defined as an indivisible unit of work comprised of several operations, all or none of which must be performed in order to preserve data integrity.

For example, a transfer of 00 from your checking account to your savings account would consist of two steps: debiting your checking account by 00 and crediting your savings account with 00. To protect data integrity and consistency -- and the interests of the bank and the customer -- these two operations must be applied together or not at all. Thus, they constitute a transaction. Properties of a transaction All transactions share these properties: atomicity, consistency, isolation, and durability (represented by the acronym ACID). Atomicity: This implies indivisibility; any indivisible operation (one which will either complete fully or not at all) is said to be atomic.Consistency: A transaction must transition persistent data from one consistent state to another. Transaction isolation levels The isolation level commit() or .