background preloader

Transactions

Facebook Twitter

X/Open XA. In computing, the XA standard is a specification by The Open Group for distributed transaction processing (DTP).

X/Open XA

It describes the interface between the global transaction manager and the local resource manager. The goal of XA is to allow multiple resources (such as databases, application servers, message queues, transactional caches, etc.) to be accessed within the same transaction, thereby preserving the ACID properties across applications. XA uses a two-phase commit to ensure that all resources either commit or rollback any particular transaction consistently (all do the same). XA stands for "eXtended Architecture" and is an X/Open group standard for executing a "global transaction" that accesses more than one back-end data-store. XA specifies how a transaction manager will roll up the transactions against the different data-stores into an "atomic" transaction and execute this with the two-phase commit (2PC) protocol for the transaction.

See also[edit] Two-phase commit protocol. In a "normal execution" of any single distributed transaction ( i.e., when no failure occurs, which is typically the most frequent situation), the protocol consists of two phases: The commit-request phase (or voting phase), in which a coordinator process attempts to prepare all the transaction's participating processes (named participants, cohorts, or workers) to take the necessary steps for either committing or aborting the transaction and to vote, either "Yes": commit (if the transaction participant's local portion execution has ended properly), or "No": abort (if a problem has been detected with the local portion), andThe commit phase, in which, based on voting of the participants, the coordinator decides whether to commit (only if all have voted "Yes") or abort the transaction (otherwise), and notifies the result to all the participants.

Two-phase commit protocol

LIXA reference guide (version 0.9.2) Manual (cold) recovery uses the information provided by the Resource Managers querying them using xa_recover().

LIXA reference guide (version 0.9.2)

This type of recovery should be used to resolve some unusual situations. If, for any reason, the LIXA state server (lixad) forgot the state of a transaction [] or the transaction is in state “recovery failed” because a previous automatic (warm) recovery failed, you have to manually recover the transaction. The procedure to recover a “forgotten” transaction is the same you use to recover a “recovery failed” one, but additional server side clean-up is suggested for “recovery failed” transactions. Recoverying forgotten transactions This example necessitates of the same environment set-up in the section called “Forcing automatic recovery”; you must start running the example program after you enabled the LIXA_CRASH_POINT environment variable: and check there is a recovery pending transaction inside PostgreSQL and Oracle Resource Managers: These are the operations you just performed: Transaction strategies: Models and strategies overview.

All too often, developers, designers, and architects confuse transaction models with transaction strategies.

Transaction strategies: Models and strategies overview

I typically ask the architect or technical lead in a client engagement to describe their project's transaction strategy. I usually get one of three responses. Sometimes it's a quiet "Oh, well, we really don't use transactions in our applications. " Other times I hear a confused "Um, I'm really not sure what you mean.

" Usually, however, I get the confident response that "We are using declarative transactions. " The three transaction models supported by the Java platform are: The Local Transaction modelThe Programmatic Transaction modelThe Declarative Transaction model These models describe the basics of how transactions should behave in the Java platform and how they are implemented. As you saw in the first article of this series, many common transaction pitfalls can affect transactional behavior and, consequently, diminish your data's integrity and consistency. Listing 1. Java Spotlight Episode 136: Paul Parkinson on JSR 907: Transaction API 1.2 @jcp (The Java Spotlight Podcast) Interview with Paul Parkinson on JSR 907: Java Transaction API 1.2 in JavaEE 7.

Java Spotlight Episode 136: Paul Parkinson on JSR 907: Transaction API 1.2 @jcp (The Java Spotlight Podcast)

Right-click or Control-click to download this MP3 file. You can also subscribe to the Java Spotlight Podcast Feed to get the latest podcast automatically. If you use iTunes you can open iTunes and subscribe with this link: Java Spotlight Podcast in iTunes. News Events Feature Interview Paul Parkinson on JSR 907: Java Transaction API 1.2. Paul Parkinson has been designing, developing, supporting, and presenting on transaction processing systems since the early 90s and has worked at Oracle for the past 10 years where he is Development Lead for Middleware Transaction Processing working on WebLogic and GlassFish application servers as well as integration with the Oracle database, Tuxedo, SOA, etc.

What’s Cool.