Diapositiva 1 - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Diapositiva 1

Description:

undo. alternatives to restoring of state (e.g. refund money...) Plain ... Ad-hoc activities responsible for undoing the effects of partial executions when ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 43
Provided by: dani266
Category:

less

Transcript and Presenter's Notes

Title: Diapositiva 1


1
From Theory to Practice in Transactional
Composition of Web Services
University of Pisa
Roberto Bruni, Gianluigi Ferrari, Hernàn
Melgratti, Ugo Montanari, Emilio Tuosto
Daniele Strollo
2
Schedule
  • Introduction to Sagas
  • Basic concepts of JTWS
  • Java Signal Core Layer (JSCL)
  • Java Transactional Layer (JTL)
  • Examples

3
Long Running Transactions
  • Transactions in e-Business scenario
  • ACID properties are relaxed
  • atomicity (long running)
  • isolation (concurrency).
  • LRTs with compensation as solution to failures
  • undo
  • alternatives to restoring of state (e.g. refund
    money)

Plain Reservation Service
Reservation Request
  • Payment Service
  • bank account (atomicity)
  • credit card (isolation)

Payment
Request for canceling reservation
4
Long Running Transactions
  • Long-Running Transactions (LRTs)
  • Independent components loosely coupled
  • Each component maintains the consistency of its
    local data
  • Illusion of Atomicity given by compensations
  • Ad-hoc activities responsible for undoing the
    effects of partial executions when the whole
    computation cannot be completed.
  • Current proposals lack from formal foundations
  • Hard to prove properties

5
Our goal
  • To provide a formally specified language for
    defining transactional aggregations at high level
    of abstraction.
  • To map high level transactional primitives into
    concrete coordination patterns.

6
Saga Calculus (SC) syntax
  • Atomic activities
  • ? 0, THROW
  • Ranged over by A, B,
  • Processes
  • P A B PP PP
  • Sagas
  • S A P SS SS

Saga Calculus naturally abstracts away from low
level computational details and communication
patterns BMM_at_POPL05. The formal semantics is
given by traces BHF_at_25YCCS,BBFHMM_at_CONCUR05.
7
Basic concepts of SC compensable process
  • Compensable process
  • P AB
  • P executes the main activity A and installs the
    compensation activity B
  • B is not installed if A is not completely
    executed
  • A is called forward flow and B the backward flow

8
Basic concepts of SC Saga
  • The process P contained in a Saga S
  • S P
  • Encloses the execution of process P in an atomic
    context.
  • The execution of successful backward flow is
    isolated from the outside.
  • Only in case of unsuccessful compensation action,
    the event is forwarded to previous stages.

9
Purchase orders
Update Credit
Accept Order
Prepare Order
10
Purchase orders without compensations
Update Credit
Accept Order
Prepare Order
S AO UC PO
The possible traces are ? S lt ,
, gtlt , , gt
AO
UC
PO
AO
UC
PO
11
Purchase orders with compensations
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
S AORO UCRM POUS
Successful execution ? S ltAO, UC, PO,
XgtltAO, PO, UC, Xgt Failure with successful
compensation (not enough money) ? S ltAO,
PO, US, RO, Xgt Failure and unsuccessful
compensation (unable to resemble stock) ? S
ltAO, PO, !gt
12
Schedule
  • Introduction to Sagas
  • Basic concepts of JTWS
  • Java Signal Core Layer (JSCL)
  • Java Transactional Layer (JTL)
  • Examples

13
JTWS Architecture
  • JSCL defines
  • Async/sync signal passing
  • Signal links
  • Logical ports
  • Handler/Emitter
  • Generic Component
  • management of flow sessions
  • JTL defines
  • Types of signals useful to represent LRTs
  • Sequential and Parallel composition of services

14
Schedule
  • Introduction to Sagas
  • Basic concepts of JTWS
  • Java Signal Core Layer (JSCL)
  • Java Transactional Layer (JTL)
  • Examples

15
JSCL application building blocks
  • Logical Ports
  • AND / OR / NOT

SIG_TRUE
SIG_TRUE
SIG_FALSE
SIG_FALSE
16
Example
eventType1
eventTypen
17
JSCL in detail
  • Connecting two components
  • The Emitter makes a request to a handler to be
    connected
  • The Handler gives the permissions to the Emitter
    to create the input signal link

connectSignal
registerSignal
18
JSCL in detail
  • Connecting two components
  • The Emitter makes a request to a handler to be
    connected
  • The Handler gives the permissions to the Emitter
    to create the input signal link
  • Forwarding a signal
  • Emitter emitSignal (signal, async)
  • Handler the method handleSignal (signal, async)
    is invoked automatically . This method
    propagates the signal to all the registered
    handlers.

The asynchronous signals are managed by the
handler.
emitSignal
handleSignal
Queue
19
Schedule
  • Introduction to Sagas
  • Basic concepts of JTWS
  • Java Signal Core Layer (JSCL)
  • Java Transactional Layer (JTL)
  • Examples

20
JTWS Java Transactional Layer (JTL)
  • Prefixed set of signals with a precise
    semantics
  • SNG_INVOKE,
  • SGN_COMMIT,
  • SGN_ROLLBACK
  • Structural composition of services
  • Sequence and Parallel
  • Well defined semantics for transactional flows.

JTL Component
21
JTL AtomicTask
  • AtomicTask defines the interface that each atomic
    activity of SC must fit.
  • We assume that any class which implements
    AtomicTask cannot throw any exception but
    AtomicActionException.

22
JTL Basic Compensable Process
  • A SC compensable process is defined in JTL as
  • Comp (A, B) A B
  • with A,B AtomicTasks.
  • The forward flow corresponds to the execution of
    A.
  • The backward flow corresponds to the the
    execution of B.
  • Exceptions are raised in presence of faults
    during execution of B.

A
B
23
JTL Basic Compensable Process...
A
Successful execution of A
Unsuccessful execution of A
Executes main activity A
B
Request for abort. Executes B.
Compensation successful executed
Compensation failure
24
JTL sequence
  • Seq (P, Q) PQ
  • JTLSequence.addInternalComponent (JTLComponent)
    permits to add new components in the sequence.

In
Out
oCt
iCt
iRb
oRb
iEx
oEx
seq.addInternalComponent (Q)
25
JTL sequence
In
Out
A
oCt
iCt
iRb
oRb
iEx
oEx
26
JTL sequence
In
Out
A
oCt
iCt
B
iRb
oRb
iEx
oEx
27
JTL sequence
In
Out
oCt
iCt
B
iRb
oRb
iEx
oEx
28
JTL sequence
In
Out
oCt
iCt
B
iRb
oRb
iEx
oEx
29
JTL sequence
In
Out
oCt
iCt
B
iRb
oRb
iEx
oEx
30
JTL sequence
In
Out
oCt
iCt
iRb
oRb
iEx
oEx
31
JTL parallel
Par (P, Q) PQ
Dispatcher
P
Q
Collector
Status (-,-)
32
JTL parallel
Dispatcher
A
P
A
Q
Collector
Status (---,---)
33
JTL parallel
Dispatcher
A
P
A
Q
Collector
Status (Inv,---)
34
JTL parallel
Dispatcher
A
P
A
Q
Collector
Status (Inv,Inv)
35
Saga in JTL
  • The behavior of a Saga S P in JTL is the
    following
  • If P sends an Inv signal
  • S propagates internally the Cmt signal
  • S sends externally the Inv signal
  • If P sends an Rb signal
  • S sends externally the Inv signal
  • If P sends an Exc signal
  • It is ignored since the status is inconsistent

36
JTL saga
In
Out
Exc and Cmt ignored while Abt is transformed to
Inv
SignalH
37
Schedule
  • Introduction to Sagas
  • Basic concepts of JTWS
  • Java Signal Core Layer (JSCL)
  • Java Transactional Layer (JTL)
  • Examples

38
Purchase Order in JTL
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
S AORO UCRM POUS
Seq ( Comp (AO, RO), Par ( Comp (UC, RM), Comp
(PO, US)))
39
Purchase Order in JTL graphical representation
Out
In
Out
In
UC
RM
AO
RO
PO
iCt
oCt
iCt
oCt
iRb
oRb
US
iRb
oRb
iEx
oEx
iEx
oEx
40
JTWS advantages
  • JSCL
  • Basic framework for programming coordination.
  • Abstraction for communication details.
  • Logical ports permit a simple design of the flow
    diagrams.
  • The connections can be modified at run-time.
  • Distributed flow execution.
  • Primitives for authorizing access to signals.
  • JTL
  • Based on a robust theory
  • Simple to program
  • Extendible to other transactional logics

41
Concluding remarks
  • From a formal specification of naïve sagas we
    have presented JTWS.
  • Contribution is a setting for designing business
    process transactions
  • Visual/graphical representation of parallel sagas
  • Process calculus description in bijective
    correspondence with sagas diagrams
  • Executable, distributed translation of symbolic
    processes
  • Future works
  • GUI to develop JTL and JSCL components
  • Debugger environment to test the behavior of the
    involved components
  • Support for advanced features like nesting,
    speculative choice (N. Zappone).

42
oOOo lt(. .)gt oOOo
  • ?

43
Semantics of Saga Calculus.
COMPOSITION OF STANDARD TRACES
int(p,q) represents all the possible interleaving
of the observable flows p,q.
44
Semantics of Saga Calculus..
TRACES OF Naive Sagas
45
Semantics of Saga Calculus...
COMPOSITION OF COMPENSABLE TRACES
46
Semantics of Saga Calculus.
TRACES OF COMPENSABLE PROCESSES
47
JSCL in detail
  • Connecting two components
  • The Emitter makes a request to a handler to be
    connected
  • The Handler gives the permissions to the Emitter
    to create the input signal link
  • Forwarding a signal
  • Emitter emitSignal (signal, async)
  • Handler the method handleSignal (signal, async)
    is invoked automatically . This method
    propagates the signal to all the registered
    handlers.

The asynchronous signals are managed by the
handler.
Write a Comment
User Comments (0)
About PowerShow.com