Professional Documents
Culture Documents
CTO Tuesdays #47: Compensation
CTO Tuesdays #47: Compensation
Compensation
“Undoing work when things go wrong”
1
Some GoToWebinar Tips
2
Welcome to CTO Tuesdays
Agenda
– Presentation of the topic
– Panel Q&A
3
Today’s Topic
Compensation
Dr. Michael Rowley, CTO, Active Endpoints
4
Long-running Transactions
5
ACID Transactions
Transaction managers
– Uses locks to provide the desired level of isolation
– Uses 2-phase commit to achieve atomicity, consistency and durability
z Phase 1: provisionally store the change for each resource
z Phase 2: officially accept the change for each resource
6
ACID Transactions and Business Processes
Business transactions
– Last too long to use locks and so
transaction managers don’t help
– Don’t require isolation
z Allow
temporary visibility for incomplete
updates
– Constraints must only be met when
the transaction completes
7
Compensation in Business Processes
8
BPEL Scopes
9
Faults Overview
10
Compensation using Boundary Events
11
Compensation in Event Subprocesses
12
Compensation Handling
Process 4. Compensate
previous work
Scope
5. Propagate Compensation Fault
compensation Handler Handler
3. Fault triggers
process-level
Compensation Compensation
6. Undo work fault handler
Handler Handler
(in reverse order)
1. Do some work (successfully invoke two services) 2. Invoke another service (throws fault)
13
Default Compensation Handling Scenario
Scope B
Compensation
Compensation handler found, Handler
perform compensation
14
Data Seen During Compensation
Compensation handlers
– Use data from the snapshot to invoke external services that will undo the
work
– Update data from parent scopes that are still running
15
Transaction Best Practices
Create compensation handlers for each activity other than the last
activity in the scope
Use data from the locally scoped variables to construct service calls
that will undo the work for that iteration
16
More Information and Contact Details
17