1 Transactions and Web Services. 2 Web Environment Web Service activities form a unit of work, but ACID properties are not always appropriate since Web.

Slides:



Advertisements
Similar presentations
Two phase commit. Failures in a distributed system Consistency requires agreement among multiple servers –Is transaction X committed? –Have all servers.
Advertisements

Web Services Transaction Management (WS-TXM) Michael Felderer Digital Enterprise Research Institute
WS-AtomicTransaction Mark Little, Chief Architect Arjuna Technologies Ltd.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
CS 603 Handling Failure in Commit February 20, 2002.
1 Chapter 3. Synchronization. STEMPusan National University STEM-PNU 2 Synchronization in Distributed Systems Synchronization in a single machine Same.
Chap 16. Transactions. Transactions Transaction: sequence of operations such that the entire sequence appears as one indivisible operation Indivisibility.
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Transaction Processing Lecture ACID 2 phase commit.
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
CS 582 / CMPE 481 Distributed Systems
Transaction Management and Concurrency Control
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
6/27/2015Page 1 This presentation is based on WS-Membership: Failure Management in Web Services World B. Ramamurthy Based on Paper by Werner Vogels and.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Distributed Commit. Example Consider a chain of stores and suppose a manager – wants to query all the stores, – find the inventory of toothbrushes at.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Analyzing different protocols for E-business 1 Fatma Sayed Gad Elrab Supervisors Prof. Dr. Ezzat abd El Tawab Korany Dr. Saleh Abdel Shachour El Shehaby.
Transactional Web Services, WS-Transaction and WS-Coordination Based on “WS Transaction Specs,” by Laleci, Introducing WS-Transaction Part 1 & 2, by Little.
Page 1 13/08/2015 The development of Web Transactions Mark Little, Distinguished Engineer, HP.
Service Oriented Architecture Master of Information System Management Service Oriented Architecture Lecture 9 Notes from: Web Services & Contemporary.
Distributed Commit Dr. Yingwu Zhu. Failures in a distributed system Consistency requires agreement among multiple servers – Is transaction X committed?
Service Oriented Architecture Master of Information System Management Service Oriented Architecture Notes from: Web Services & Contemporary SOA.
Service Oriented Computing Burr Watters Tasha Wells April 5, 2004.
Chapter 19 Recovery and Fault Tolerance Copyright © 2008.
Distributed Transactions Chapter 13
PAVANI REDDY KATHURI TRANSACTION COMMUNICATION. OUTLINE 0 P ART I : I NTRODUCTION 0 P ART II : C URRENT R ESEARCH 0 P ART III : F UTURE P OTENTIAL 0 R.
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
1 WS-Routing. 2 Why WS-Routing? SOAP (by itself) doesn’t define a message path –Header blocks describe functions to be performed by intermediaries that.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Transactions with Unknown Duration for Web Services Patrick Sauter, Ingo Melzer.
University of Tampere, CS Department Distributed Commit.
Chapter 15 Recovery. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.15-2 Topics in this Chapter Transactions Transaction Recovery System.
Replication (1). Topics r Why Replication? r System Model r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric.
XA Transactions.
Distributed Transactions Chapter – Vidya Satyanarayanan.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Recovery Management in QuickSilver Roger Haskin, Yoni Malachi, Wayne Sawdon, and Gregory Chan IBM Almaden Research Center.
© 2008 Progress Software Corporation1 SOA-33: Transactions in a SOA World What happens next? Flight Booking Hotel Booking Car Booking (3) Calls (2) Change.
Two-Phase Commit Brad Karp UCL Computer Science CS GZ03 / M th October, 2008.
Revisiting failure detectors Some of you asked questions about implementing consensus using S - how does it differ from reaching consensus using P. Here.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
05/11/2011ecs251 spring 2011, midterm1 ecs251 Spring 2011 midterm Name: Student ID: Open book/laptop/Internet and totally 10 questions (choose at.
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Database recovery techniques
Database Recovery Techniques
Service Oriented Computing
Chapter 19: Distributed Databases
Two phase commit.
Outline Announcements Fault Tolerance.
Distributed Commit Phases
Chapter 10 Transaction Management and Concurrency Control
Distributed Transactions
B. Ramamurthy Based on Paper by Werner Vogels and Chris Re
Database Recovery 1 Purpose of Database Recovery
By Werner Vogels and Chris Re
By Werner Vogels and Chris Re
WS Standards – WS-* Specifications
Managing Process Integrity (Chapter 8)
Presentation transcript:

1 Transactions and Web Services

2 Web Environment Web Service activities form a unit of work, but ACID properties are not always appropriate since Web is loosely coupled and activities are frequently long- running –Communication delays –Server loading (and hence response time) is unpredictable –Locks might not be retained for duration of activity –Servers are controlled by different organizations –Modules might not trust each other –Failures more likely

3 Web Services Interactions A generalization of the transaction construct needed to coordinate the execution of an activity on the Web BPEL does not support transactions (although it provides for compensation) Protocols for organizing activities in different ways and providing some form of atomicity are under development –WS-Coordination –WS-AtomicTransaction –WS-BusinessActivity

4 Coordination Refers to the mechanism used by the components of an activity to reach common agreement: –How are components identified? –How are exceptional situations to be handled? System related failures (e.g., crash, communication failure) Application related exceptions (e.g., unanticipated messages) –What constitutes successful termination?

5 Overview A coordinator supports three services: –Activation Service: part of WS-Coordination Create a new activity with a particular CoordinationType: AtomicTransaction or BusinessActivity –Each type supports several termination protocols; a participant can choose the protocol appropriate to its role in the activity –Registration Service: part of WS-Coordination Allow each participant to register for a protocol within the type –Different participants in the same activity might use different protocols –Protocol Service: supports the execution of the protocol as specified in WS-AtomicTransaction or WS-BusinessActivity

6 WS-Coordination An application that wants to initiate an activity invokes the CreateCoordinationContext() operation of the Activation Service of a coordinator to create a coordination context –Identifier: unique over all activities –CoordinationType: atomic transaction or business activity Coordination logic can optionally be specified: e.g., coordinator should use majority rule (or unanimity) in deciding outcome –EndpointReference: used to address the registration service to register for a particular protocol supported by the CoordinationType

7 Creating an Activity 1 A1 invokes CreateCoordinationContext() to get a context, con A, for a new activity of coordination type Q from coordinator CA A1 sends an application message containing the context to A2 When SOAP is used, the context is a header block with mustUnderstand=“true” A1 and A2 then use CA’s registration service to register for protocols (perhaps different, but supported by Q)

8 Creating an Activity 2 A2 might want to use a different coordinator –Reasons: performance, trust Protocol: –A2 invokes CreateCoordinationContext() at coordinator CB, passing con A as a parameter –CB creates a new context, con B, with the same identifier and CoordinationType, returns it to A2 –A1 registers for a protocol with CA –A2 registers for a protocol with CB and CB registers for the same protocol with CA

9 Creating an Activity CA CB A1 A2 CBA1 CA A2 con A =CCC() Register(con A ) con B =CCC(con A ) Register(con B ) Register(con A ) AppMsg(con A ) Message exchangeProtocol tree (1) (2) (3) (4) (5)

10 Registration Service Participant explicitly registers for a particular protocol supported by the CoordinationType. –Contrasts with two-phase commit for distributed transactions where registration is automatic when server is invoked –Participant can register several times in order to participate in activity termination in several ways.

11 WS-AtomicTransaction A coordination type that implements transactional atomicity using two-phase commit –Intended for tightly-coupled, short-lived activities within an organizational structure –Systems should trust each other They must be responsive since locks are held until protocol completes A single system can (perhaps maliciously) abort the entire transaction Protocols supported –Completion: initiates termination, final result returned (no durable resources) commit, rollback, committed, and aborted messages –Two-Phase Commit (with presumed abort) Volatile 2PC (no durable resources) Durable2PC (durable resources) prepare, vote, commit, rollback, readOnly (for cohorts that need not participate in phase 2), aborted, committed (done), and replay (for cohorts dealing with failure) messages A participant might register for both completion and 2PC

12 Volatile vs. Durable 2PC Identical protocols with the following exceptions –All cohorts registered for volatile 2PC must respond to coordinator with vote messages before coordinator sends prepare messages to cohorts registered for durable 2PC –Cohort registered for volatile 2PC is not guaranteed to receive commit/abort message from coordinator (since it does not support durable resources, the message serves no purpose)

13 Volatile Two-Phase Commit Used for caching web services Problem: Suppose WS1 is a caching service for data durably stored at WS2. A mechanism is needed to force updates of a transaction, T, cached at WS1 (e.g., dirty pages) to WS2 when T completes. –But completion is not known until a cohort registered for the completion protocol sends a commit message to the coordinator

14 Volatile Two-Phase Commit Solution: –WS1 registers for volatile 2PC, WS2 registers for durable 2PC –WS1 forces T’s dirty data to WS2 when it receives prepare message, prior to responding to coordinator with vote message –WS2 knows the operations it must perform to complete T before the prepare message arrives WS2 can make resources durable before voting –Since WS1 does not have to store data durably, it does not need to know T’s outcome

15 Business Activities WS-AtomicTransaction coordination type implements global atomicity WS-BusinessActivity coordination type is intended for loosely-coupled, long-lived activities that span autonomous web-services –Participants might make state transitions durable and visible immediately Compensating actions must be used to reverse actions –Participants might withdraw unilaterally while activity is active Membership in activity is dynamic –Generally constructed from atomic transactions –Activity might span multiple trust domains Enforcing global atomicity is problematic if systems are unresponsive or untrustworthy

16 Exceptions and Business Activities Atomic transactions are designed to handle system generated exceptions (crash, deadlock, communication failure) –Rollback guarantees a return to a consistent state –Inconsistent states are not visible

17 Exceptions and Business Activities A business activity generally uses atomic (sub-) transactions to move application from one consistent (intermediate) state to another. –Atomic (sub-) transactions handle system generated exceptions. –Application logic (using compensation) handles application-generated exceptions. –A1 might invoke A2 in a business activity, BA. A2 might create an atomic transaction (different Id), AT. A2 can commit AT immediately or wait until BA completes

18 Application-Generated Exceptions What do you do if –a service doesn’t respond? Abort business activity or find another service that does the same thing or continue processing (response is not essential) –a service sends an unanticipated messsage? Abort business activity or notify initiator or discard message –Since action might depend on application state it is convenient to integrate coordination with the application

19 WS-BusinessActivity WS-BusinessActivity coordination type supports two protocols –BusinessAgreementWithParticipantCompletion (BAWPC) Participant registering for this protocol can initiate termination –BusinessAgreementWithCoordinatorCompletion (BAWCC) Participant registering for this protocol expects coordinator to tell it when to terminate

20 WS-BusinessActivity Components of same business activity might register for different protocols depending on who is responsible for determining completion –Root application might register for BAWPC, other participants for BAWCC –Cache participant might register for BAWCC; initiator for BAWPC

21 BAWPC Messages Completed – analagous to a vote message Exit – participant leaves the protocol Cancel – participant is forced out of the protocol by the coordinator Close/Compensate – in completed state coordinator decides on outcome based on coordination logic specified in context Fault – participant notifies coordinator that it has failed

22 Example Buyer sends copies of a purchase order to sellers A, B, C –A can’t make a quote, responds with fault message –B and C make quotes using completed message Indicates that B and C have completed successfully Buyer chooses B –Notifies B using close message Indicates that B has successfully participated in a terminated business activity –Notifies C using compensate message Indicates that C should rollback any action it has taken

23 BAWPC State Diagram cancelling exiting activecompleted compensating faulting closingended fault cancel completed exit exited cancelled close closed fault faulted compensated coordinator generated participant generated compensate participant signals completion to coordinator Participant leaves protocol state of protocol between coordinator and a participant

24 BAWCC State Diagram cancelling exiting active completed compensating faulting closingended fault cancel completed exit exited cancelled close closed fault faulted compensated coordinator generated participant generated completing complete cancel compensate coordinator signals completion to participant