Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Transactional Web Services

Transactional Web Services

What are ACID transactions? How do they change to work with Web services? And how do the ACID guarantees work when you must use compensating actions?

Transactions - Formal and Informal
To many people, a "transaction" is a business exchange where money is traded for goods. To software engineers the meaning is more technical. Informally, a transaction implies that a group of activities is completed as a unit, so they all succeed or all fail together. This "all or none" semantic is fundamental to database access.

In the formal model, the groupings we call transactions have properties known by the acronym ACID - they are Atomic, Consistent, Isolated, and Durable (see Table 1).

Enterprise systems, including many parts of Java 2, Enterprise Edition (J2EE), support transactional semantics. For example, Enterprise JavaBeans (EJBs; for storage operations) and the Java Message Service (for messages) have transactional guarantees on their behavior. JTA/JTS (the Java Transaction API and the Java Transaction Service) provide standard APIs for accessing the transactional capabilities provided in compliant software.

ACID and Compensating Transactions
ACID transactions are critical to business interactions - a bank wants to ensure that your account is credited exactly once for a deposit, and you want to ensure that your account is debited exactly once for a withdrawal. Likewise, changes in the data stored in an EJB must be accessed only when it is internally consistent - transactions guarantee that consistent view.

To ensure consistency, typically all database entries being used by an ACID transaction are locked for the duration. If a transaction fails, the database state is rolled back to its previous state. This capability is provided by database vendors.

But locking cannot work across enterprises. When you make a hotel reservation, your travel agent cannot lock the hotel's reservation database for as along as the reservation exists (or even as long as a phone call) or the system would grind to a halt. Instead, an ACID transaction local to the hotel chain's database as a single unit of work (1) updates the room inventory, (2) adds information to the reservation table, and (3) generates a confirmation number. If the travel agent needs to undo that reservation, a compensating action is taken. Sometimes there's a cost to compensate - for example, if the reservation is cancelled too late, there may be a charge.

Compensation is specific to the way business data is managed, so it's always part of business logic. This is very different from the automatic rollback provided by databases for ACID transactions. Compensation avoids another problem. Locking of your company's data by anyone on the Internet allows denial-of-service attacks. Using compensation means that your data isn't locked for a long time, but we can no longer have ACID transactions - at least the Isolation guarantees must be relaxed - because the data is visible between the initial change and the compensation.

In effect, one trades softening of the ACID guarantees for flexibility, safety, and control over one's own data.

Do We Need Web Services Transactions?
Businesses have been doing without Web services (and similar long-running distributed transactions) for a long time. Do we really need them?

In many cases the answer is "no" - for many business needs, a reliable transport (which itself may use local transactions at the ends) plus a simple application protocol will suffice. Many interactions are between just two parties, so general termination protocols are more complicated than necessary. For example, RosettaNet and ebXML Collaborations are inherently two party.

For more complex scenarios, such as interactions managed in a business process environment (see Yaron Goland's article, "The Race to Create Standards," Vol. 2, issue 6), the answer is a qualified "yes" - in part because these are new assemblies of piece parts, and in part because the complexity of systems goes up. I'll return to this question after we look at transaction specifications.

The Specifications - Overview
I've already mentioned ACID transactions and JTA/JTS. The Open Group (formerly X/Open) Distributed Transaction Processing XA specification (1991) defines ACID transactions. JTA/JTS were first specified in the late 1990s.

In XML and Web services there are two key specifications: Business Transaction Processing (BTP) from the OASIS standards organization, published in May 2002; and WS-Transaction with its accompanying specification, WS-Coordination, published by BEA, IBM, and Microsoft, in August 2002.

These specifications have two key concepts in common: compensation instead of rollback, and the use of business logic to determine success or failure rather than all-or-none.

OASIS BTP provides two types of transactions. Atoms resemble ACID transactions in that the result is all-or-none - all of the participants succeed, or the transaction fails and the participants compensate for any completed actions.

Cohesions are more flexible. A central coordinator reviews the status of each member of the transaction. Even if some of the members cannot successfully commit the transaction the coordinator can still decide to allow the remaining members to commit. In an ACID transaction such partial success is failure, and all participants must roll back.

For example, you might tentatively reserve rooms at several hotels while building an itinerary, but at the end you only need one hotel for each night, and one flight to the destination. So even if attempting to reserve a room fails at all but one hotel, the transaction can still succeed (see Figure 1).

WS-Coordination and WS-Transaction
This family of two specifications (three, if you count the subparts of WS-Transaction separately) covers much the same territory as BTP cohesions, but adds ACID transactions with Web services as the transport.

WS-Coordination factors out the management and propagation of transaction contexts from the WS-Transaction family of protocols. Context management is a key part of transaction systems. Factoring it out makes it easier to create additional protocols on top of WS-Coordination.

WS-Transaction has two largely unrelated subparts, atomic transactions (AT) and business activities (BA).

WS-Transaction/AT defines ACID transactions using Web services. The goal is to allow interoperability with older ACID-based systems within an enterprise - not across enterprises, for all the reasons we've discussed.

WS-Transaction business activities are another thing altogether - they resemble BTP cohesions, but are tailored as an implementation infrastructure for Business Process Execution Language for Web Services (BPEL4WS), also published in August 2002. Work on BPEL4WS is continuing in an OASIS Technical Committee (see References).

BAs are similar to BTP cohesions: compensating actions are used to undo partially completed work. Business logic (as with cohesions) or a defined business process determine the success or failure of a particular BA.

BAs share the terminology and model with BPEL; the complexities of BA mirror the complexity for an execution language for business processes. In fact, the "BPEL use case" of cross-enterprise business processes and collaboration, as and when they achieve critical mass, are the most compelling use case for WS-Transaction.

Time will tell how rapidly and broadly the adoption of BPEL proceeds, which in turn will drive the adoption of supporting standards.

Future Standards
In the short term, WS-Coordination and WS-Transaction should be submitted to a standards body to start the progress from public specification to standard.

For the longer term, value will be driven by the possibility of legacy integration across operating systems (in the case of AT), and will likely be driven by the attraction of business process integration, management, and execution (in the case of business activities, BTP, or their successors).

At press time, a set of specifications (Web Services Composite Application Framework) was published and promised to be submitted to a standards organization. These overlap with BTP, WS-Transaction, and WS-Coordination. This publication may further accelerate convergence and standardization.

Transactions between enterprises, and support for complex business process execution have driven consideration of technologies that relax some of the ACID transaction guarantees that programmers have used for many years. The need for compensation, rather than rollback, is one basic difference.

The other change is in definitions of success. All-or-nothing semantics work very well in most cases, but the notion of success for a transaction has begun evolving to mean success of a business process, rather than all parts of a transaction are complete.

The WS-Transaction and BTP protocols are among the first formalizations of this new approach, and have similar models. The next months should see the start of standardization of the newer WS-Transaction and WS-Coordination protocols. The widespread adoption of such protocols will depend on the rapidity of adoption of business process environments.

BEA cofounded OASIS BTP, and is a coauthor of the WS-Coordination and WS-Transaction public specifications. We look forward to continuing to drive convergence and broadly accepted standardization in these emerging areas.


  • Andrade, Juan, et al. (1996). The Tuxedo System: Software for Constructing and Managing Distributed Business Applications. (Addison-Wesley)
  • Gray, Jim; and Reuter, Andreas (1993). Transaction Processing: Concepts and Techniques (Morgan-Kaufmann)
  • The Open Group (1992). Distributed TP: The XA Specification. Free PDF: www.opengroup.org/products/ publications/catalog/c193.htm
  • OASIS BTP Technical Committee: www.oasis-open.org/committees/ tc_home.php?wg_abbrev=business-transaction. For the specification and primer follow the Documents link at the upper right.
  • WS-Coordination 1.0 (August 2002): http://dev2dev.bea.com/technologies/ webservices/standards.jsp
  • WS-Transaction 1.0 (August 2002): http://dev2dev.bea.com/technologies/ webservices/standards.jsp
  • OASIS Web Services Business Process Execution Language (WS-BPEL) Technical Committee: www.oasis-open.org/committees/ tc_home.php?wg_abbrev=wsbpel
  • Cox, William; and Dalal, Sanjay. "Web Services and Transactions," OMG Workshop on Web Services and the Integrated Enterprise (Philadelphia, April 2003). Earlier version online at www.omg.org/news/meetings/workshops/ WebServEurope_Manual/04-2_Cox.pdf
  • More Stories By William Cox

    William Cox is a Technical Director in the BEA CTO Office, concentrating on transactional and portal architecture. He is a co-author of BTP, the BTP Primer, and of WS-Transaction. He holds an M.S. and Ph.D. in Computer Sciences from the University of Wisconsin–Madison.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

    @ThingsExpo Stories
    "Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
    "Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
    Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
    "Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    "MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    "There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
    It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
    WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
    Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...