WS Transaction Specs - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

WS Transaction Specs

Description:

short running atomic transactions can be part. of a long running business transaction. ... long running business transaction completes, and in the event of the long ... – PowerPoint PPT presentation

Number of Views:76
Avg rating:3.0/5.0
Slides: 35
Provided by: gokceban
Category:

less

Transcript and Presenter's Notes

Title: WS Transaction Specs


1
WS Transaction Specs
  • Gokce Banu Laleci
  • METU-SRDC

2
Transactions
  • Distributed system
  • Reliability problems
  • Subject to independent failure of any of its
    components
  • Decentralization allows
  • Parts of the system fail
  • Other parts remain functioning
  • Abnormal behavior

3
ACID Properties
  • Atomicity The transaction completes successfully
    (commits) or if it fails (aborts) all of its
    effects are undone (rolled back)
  • Consistency Transactions produce consistent
    results and preserve application specific
    invariants
  • Isolation Intermediate states produced while a
    transaction is executing are not visible to other
    transactions
  • appear to execute serially
  • achieved by locking resources
  • Durability The effects of a committed
    transaction are never lost (except by a
    catastrophic failure)s

4
Atomic Transactions
  • can be terminated in two ways
  • Committed
  • all changes made within it are made durable
  • Aborted (rolled back)
  • all changes made during the lifetime of the
    transaction are undone

5
Why Atomic transactions may be too strong
  • Suitable for short lived applications
  • Long-lived transactions may reduce the
    concurrency
  • By holding onto resources for a long time
  • If it aborts
  • Much valuable work already performed will be
    undone
  • Pure ACID transactions are not suitable for Web
    Services
  • WS Transactions
  • Atomic transactions
  • Business Activities

6
A Suit of Specifications
  • As a response to these needs in July 2002, BEA,
    IBM, and Microsoft released a trio of
    specifications designed to support business
    transactions over Web services
  • BPEL4WS,
  • WS-Transaction, and
  • WS-Coordination

7
Two Distinct Models
  • WS-Transaction specification proposes two
    distinct models
  • Atomic transaction (AT) Model is used to
    coordinate activities having a short duration and
    executed within limited trust domains
  • Business Activity (BA) Model is used to
    coordinate activities that are long in duration
    and desire to apply business logic to handle
    business exceptions

8
WS-C WS-TX
  • WS-C
  • Provides a generic framework for coordination
    protocols to be plugged in

9
Participants Transaction aware Web services
10
Participants Transaction aware Web services
JAXTX
11
Atomic Transactions
  • Similar to traditional ACID transactions
  • Services enroll transaction-aware resources
  • Databases
  • Message queues

12
The Players
  • Completion Initiator
  • Application
  • Signals coordinator to complete a transaction
  • Can request commit or rollback
  • Coordinator
  • Responsible for coordinating a single outcome
  • Drives 2PC with participants
  • Phase 1 Ensure all participants are prepared
  • Phase 2 Notify participants of outcome
  • Participants
  • can vote to abort
  • Can vote prepared to commit
  • Must honor coordinators commit decision

13
Protocols
  • Completion
  • Client application

14
Coordinators Completion Service
15
Participants Completion Service
16
(Another advantage)
  • traditional transaction systems talk to one
  • opportunity to leverage an unparalleled
    interoperability technology to splice together
    existing transaction processing systems that
    already form the backbone of enterprise level
    applications

17
Protocols
  • 2PC

18
Other protocols
  • CompletionWithAck
  • Same as Completion, but the coordinator must
    remember the outcome until receipt of an
    acknowledgment notification
  • PhaseZero
  • A participant that wants the coordinator to
    notify it just before the 2PC protocol begins
    registers for this A typical example is an
    application that caches data and needs a
    notification to write outstanding updates to a
    database
  • OutcomeNotification
  • A transaction participant that wants to be
    notified of the commit-abort decision registers
    for this

19
A walkthrough
20
Step1
  • An application creates a transactional activity
    using the WS-Coordination framework's Activation
    Service

21
Step1
  • Coordination Service returns
  • Coordination Context
  • includes the address of the Registration

22
Step 2
  • The application defines itself as the artifact
    responsible driving the Completion protocol to
    complete the activity
  • The role of coordinator is defined within the
    Coordination Service
  • the CoordinatorRef is returned on the call
  • application uses later to invoke the Completion
    protocol

23
Step2
24
Step3
  • The application performs some operation on a Web
    service

25
Step4- Service Registers 2PC
26
Step 5- Registration Service Responds
27
Step6 WS returns result
28
Step 7 Application commits
29
Step8 Coordinator sends Prepare
30
Step 9 WS-Participant sends prepared
31
Step 10 Coordinator sends commit
32
Step 11 WS-Participant sends committed
33
Business Activity
34
  • short running atomic transactions can be part
  • of a long running business transaction. The
    actions of the embedded atomic transactions are
    committed and made visible before the
  • long running business transaction completes, and
    in the event of the long running business
    transaction failing, the effects of such
  • atomic transactions need to be compensated for,
    that is, open nested transactions.
Write a Comment
User Comments (0)
About PowerShow.com