Implementing Transactions in JOIN Calculus - PowerPoint PPT Presentation

About This Presentation
Title:

Implementing Transactions in JOIN Calculus

Description:

Fifth level. Sequential Sagas: Semantics. An activity A either ... (saga) A , A%B, , 0 ,0 , 0 (f-cmp) A , A%B, , 0 ,0 , 0 P,0 , ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 46
Provided by: diUn
Category:

less

Transcript and Presenter's Notes

Title: Implementing Transactions in JOIN Calculus


1
Theoretical Foundations for Compensations in Flow
Composition Languages
Hernán Melgratti Joint work with Roberto Bruni
and Ugo Montanari Dipartimento di Informatica -
Università di Pisa
2
Motivations Web Service Composition
  • Defining complex services as aggregations of
    simpler services
  • Interaction based Composition, Conversational
    Patterns or Global Model
  • Services describe the ways they can be engaged in
    a larger process
  • Flow Composition or Hierarchical Patterns
  • Similar to workflow systems a process describes
    the flow of both control and data among WS

3
Motivations Flow Composition
A3
A2
A1
A5
A4
4
Motivations Transactional Flow
Transactional Process
A3
A2
A1
A5
A4
5
Motivations Compensation
Transactional Process
A3
A2
B3
B2
A1
A5
B1
B5
A4
B4
6
Motivations Compensation Flow
Transactional Process
A3
A2
B3
B2
A1
A5
B1
B5
A4
B4
7
Outline of the talk
  • Sequential Sagas
  • Graphical representation
  • Syntax and Semantics
  • Adequacy results
  • Parallel Sagas
  • Nested Sagas
  • Additional features
  • Concluding remarks

8
Sequential Sagas Graphical Repr.
Accept Order
Update Credit
Prepare Order
Refuse Order
Refund Money
Update Stock
9
Sequential Sagas Syntax
Accept Order
Update Credit
Prepare Order
Refuse Order
Refund Money
Update Stock
(Step) X 0 A AB (Process) P X
PP (Saga) S P
10
Sequential Sagas Syntax
Accept Order
Update Credit
Prepare Order
Refuse Order
Refund Money
Update Stock
S AORO UCRM POUS
(Step) X 0 A AB (Process) P X
PP (Saga) S P
11
Sequential Sagas Semantics
  • An activity A either
  • commits (A ? )
  • aborts (A ? )
  • ? A1 ? ,, An ?

12
Sequential Sagas Semantics
  • A saga S P under ? either
  • commits ( )
  • aborts ( )
  • fails ( )
  • ? is the observable flow

?
? S ??
?
?
? S ??
?
?
? S ??
?

13
Sequential Sagas Semantics
  • A process P under ? either
  • commits (
    )
  • aborts ( )
  • fails ( )
  • ß and ß are the installed compensations

14
Sequential Sagas Semantics
(saga)
15
Sequential Sagas Semantics
(saga)
(zero)
16
Sequential Sagas Semantics
(saga)
(zero)
(s-act)
17
Sequential Sagas Semantics
(saga)
(zero)
(s-act)
?
? ltß,0gt ?? lt , 0gt
?
(s-cmp)
?
A ? , ? ltAB,ßgt ?? lt , 0gt
?
?
? ltß,0gt ?? lt , 0gt
?
(f-cmp)
?
A ? , ? ltAB,ßgt ?? lt , 0gt
?

18
Sequential Sagas Semantics
?
?
? ltQ,ßgt ?? lt ,ßgt
? ltP,ßgt ?? lt ,ßgt
?
?
(s-step)
??
? ltPQ, ßgt ?? lt ,ßgt
?
?
? ltP,ßgt ?? lt , 0gt
?
(a-step)
?
? ltPQ,ßgt ?? lt ,0gt
?
?
? ltP,ßgt ?? lt , 0gt
?

(a-step)
?
? ltPQ,ßgt ?? lt ,0gt
?

19
Sequential Sagas Adequacy Theorem
?
and ? A1An
? S ??
?
A1
Aj
Ak
An
20
Sequential Sagas Adequacy Theorem
?
and ? A1An
? S ??
?
A1
Aj
Ak
An
?
and ? A1Ak-1Bk-1B1
? S ??
?
Ak
A1
Aj
An
Bj
B1
21
Sequential Sagas Adequacy Theorem
?
and ? A1An
? S ??
?
A1
Aj
Ak
An
?
and ? A1Ak-1Bk-1B1
? S ??
?
Ak
A1
Aj
An
Bj
B1
?
and ? A1Ak-1Bk-1Bj1
? S ??
?

A1
Aj
Ak
An
Bj
B1
22
Parallel Sagas Graphical Representation
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
23
Parallel Sagas Syntax
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
(Step) X 0 A AB (Process) P X PP
PP (Saga) S P
24
Parallel Sagas Syntax
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
S AORO UCRM POUS
(Step) X 0 A AB (Process) P X PP
PP (Saga) S P
25
Parallel Sagas The Naïve Way
B1
Bj
Bn
B1
Bj
A1
A2
A1
C1
Ck
Cm
C1
Ck
Cm
A1(B1Bj-1Bj-1B1 C1CmCmC1)A1
26
Parallel Sagas Revised
B1
Bj
Bn
B1
Bj
A1
A2
A1
C1
Ck
Cm
C1
Ck
Cm
A1(B1Bj-1Bj-1B1 0)A1
A1(B1Bj-1Bj-1B1 C1C1)A1

A1(B1Bj-1Bj-1B1 C1CmCmC1)A1
27
Parallel Sagas Semantics
  • A process P under ? either
  • commits (
    )
  • aborts ( )
  • fails ( )
  • is forced to abort (
    )
  • is forced to fail (
    )
  • ? is the observable concurrent flow

?
? ltP,ßgt ?? lt ,ßgt
?
?
? ltP,ßgt ?? lt , 0gt
?
?
? ltP,ßgt ?? lt , 0gt
?

?
? ltP,ßgt ?? lt , 0gt
?
?
? ltP,ßgt ?? lt , 0gt
?
28
Parallel Sagas Semantics
?
? ltP,0gt ?? lt?, ßgt
? ? , ,
?
(saga)

?
? P ?? ?
?
(forced-abt)
(forced-abt)
29
Parallel Sagas Semantics
(s-par)
30
Parallel Sagas Semantics
(c-par)
?1, ?2 ? ,
?
?
?
? ltP,0gt ?? lt?1,0gt
? ltQ,0gt ?? lt?2,0gt
? ltß,0gt ?? lt ,0gt
?
?
?
?? ?
? ltPQ, ßgt ???? lt ?1 ? ?2 , 0gt
?
?

?
?
?
?







31
Parallel Sagas Semantics
(c-par)
?1, ?2 ? ,
?
?
?
? ltP,0gt ?? lt?1,0gt
? ltQ,0gt ?? lt?2,0gt
? ltß,0gt ?? lt ,0gt
?
?
?
?? ?
? ltPQ, ßgt ???? lt ?1 ? ?2 ? , 0gt
?
?

?
?
?
?







32
Parallel Sagas Semantics
(f-par)
?1 ? ,
?
?

? ltP,0gt ?? lt?1,0gt
? ltQ,0gt ?? lt?2,0gt
?
?
?2 ? , , ,

??
? ltPQ, ßgt ??? lt ?1 ? ?2 , 0gt
?
?

?
?
?
?







33
Parallel Sagas Adequacy
Completion
34
Parallel Sagas Adequacy
Successful Compensation
35
Parallel Sagas Adequacy
Failed Compensation
36
Nested Sagas Graphical Representation
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
Add Points
Subtract Points
37
Nested Sagas Syntax
(Step) X 0 A AB S (Process) P X
PP PP (Saga) S P
38
Nested Sagas Syntax
Update Credit
Refund Money
Accept Order
Refuse Order
Prepare Order
Update Stock
Add Points
Subtract Points
S ? AORO UCRM POUS APSP
39
Nested Sagas Semantics
?
? ltP,0gt ?? lt , ßgt
?
(sub-cmt)
?
?
? ltP,ßgt ?? lt , ßßgt
ß acts as default compensation
?
? ltP,0gt ?? lt , 0gt
?
(sub-abt)
?
?
? ltP,ßgt ?? lt , ßgt
?
? ltP,0gt ?? lt , 0gt
?

(sub-fail)
?
? ltP,ßgt ?? lt , 0gt
?

40
Nested Sagas Semantics
(sub-forced-1)
(sub-forced-2)
(sub-forced-2)
41
Nested Sagas Adequacy
Completion
42
Nested Sagas Adequacy
Successful Compensation
43
Nested Sagas Adequacy
Failed Compensation
44
More on Sagas
  • Exception handling try S with P
  • Used to catch crashes during backward computation
  • Forward recovery strategies try S or P
  • Can be used to retry or to improve activities
  • Fully programmable compensations SP
  • More expressive than default compensation
    (sub-cmt)
  • Allowed by languages like BPEL4WS
  • Choices
  • discriminator P?Q
  • internal P?Q
  • Data dependencies A?B
  • Valid executions must satisfy dependency
    constraints

45
Final Remarks
  • Our definition for compensable languages
  • abstracts away from low-level computations
  • can be easily extended
  • independent from the coordination mechanisms that
    implement the primitives
  • Java Transactional Web Services (JTWS)
  • Distributed implementation of flows
  • Allows to reason about program properties
  • Adequacy
  • Correctness of implementation
Write a Comment
User Comments (0)
About PowerShow.com