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
    DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of bus...
    With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading...
    DXWorldEXPO LLC announced today that "Miami Blockchain Event by FinTechEXPO" has announced that its Call for Papers is now open. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Financial enterprises in New York City, London, Singapore, and other world financial capitals are embracing a new generation of smart, automated FinTech that eliminates many cumbersome, slow, and expe...
    Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
    DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
    DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by FinTechEXPO. ICOHOLDER give you detailed information and help the community to invest in the trusty projects. Miami Blockchain Event by FinTechEXPO has opened its Call for Papers. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Miami Blockchain Event by FinTechEXPO also offers s...
    DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
    Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
    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.
    Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
    Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
    Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities - ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups.
    The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
    Predicting the future has never been more challenging - not because of the lack of data but because of the flood of ungoverned and risk laden information. Microsoft states that 2.5 exabytes of data are created every day. Expectations and reliance on data are being pushed to the limits, as demands around hybrid options continue to grow.
    Poor data quality and analytics drive down business value. In fact, Gartner estimated that the average financial impact of poor data quality on organizations is $9.7 million per year. But bad data is much more than a cost center. By eroding trust in information, analytics and the business decisions based on these, it is a serious impediment to digital transformation.
    Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
    Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
    As IoT continues to increase momentum, so does the associated risk. Secure Device Lifecycle Management (DLM) is ranked as one of the most important technology areas of IoT. Driving this trend is the realization that secure support for IoT devices provides companies the ability to deliver high-quality, reliable, secure offerings faster, create new revenue streams, and reduce support costs, all while building a competitive advantage in their markets. In this session, we will use customer use cases...
    Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
    The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.