business transactions agenda einführung grundlagen transaktionen zwei welten: web services / acid...
TRANSCRIPT
Business Business TransactionsTransactions
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
Web Services 101
Web Services sind hip!
Breites Angebot von Services
Aggregation dieser Komponenten ist der neue Weg, Anwendungen zu bauen.
SOAP als Basis für die Kommunikation bietet ein Reihe von Vorteilen.
Bu
sin
ess Tra
nsacti
on
s
Alles Neu ! Alles Besser ?
Löst Port 80 alle Probleme ?
Waren alle Probleme ungelöst ?
Bu
sin
ess Tra
nsacti
on
s
Trouble in Paradise
Fremde Komponenten verhalten sich nicht immer so wie erwünscht.
Vefügbarkeit und Latenzzeit können Problem werden.
Behandlung der möglichen Fehlerszenarien ist sehr komplex.
Bu
sin
ess Tra
nsacti
on
s
Fault (In)Tolerance
Grosse Systeme sind fehleranfällig. OO macht Systeme robuster.
Verteilte Systeme sind fehleranfälliger. Programmiermodell kann helfen.
Heterogene Systeme sind eine echte Herausforderung !
Muss der Gesetzgeber muss her ?
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
Grundlagen Transaktionen
Eine klassische Transaktion ( TA ) ist ein ‘unit of work’, die entweder erfolgreich abgeschlossen wird, oder vollkommen ohne Auswirkung bleibt.
Die wichtigen Eigenschaften von TA werden markant ‘ACID’ abgekürzt:
Atomicity: unteilbar, ganz oder gar nicht. Consistency: ein gültiger Zustand wird in
eine anderen, gültigen Zustand überführt. Isolated: Jede TA scheint ‘Highlander’ zu
sein. Durable: Der Ausgang der TA bleibt
dauerhaft gespeichert.
Bu
sin
ess Tra
nsacti
on
sTransaktionen 1. Generation
Tx.begin();
UPDATE amount = amount + 100 FROM account
WHERE id = 1000;
UPDATE amount = amount - 100 FROM account
WHERE id = 1001;
Tx.commit();
Bu
sin
ess Tra
nsacti
on
s
Verteilte Transaktionen (1)
Verteilte Transaktionen basieren auf dem Two-Phase Commit (2PC) Protokoll.
Eine Transaktion beginnt und es werden modifizierende Operationen durchgeführt.
Teilnehmende Resourcen erfahren (irgendwie) von der Transaktion
Fertig, das 2PC Protokoll beginnt :
Bu
sin
ess Tra
nsacti
on
s Phase
1
Phase
1
Verteilte Transaktionen (2)
Der Coordinator befragt jede Resource nach ihrem ‘Befinden’ :
VoteReadOnly VoteCommit VoteRollBack
Bu
sin
ess Tra
nsacti
on
s Phase
2
Phase
2
Verteilte Transaktionen (3)
Nachdem alle Resources positiv abgestimmt haben veranlasst der Coordinator die dauerhafte Speicherung (meist unter Nutzung einer DB).
Das ‘Rollback’-Veto einer Resource reicht aus, um die ganze Transaktion zu invalidieren.
Der Coordinator und die Resourcen muessen sich um das Recovery kümmern.
Bu
sin
ess Tra
nsacti
on
s
Verteilte Transaktionen !
Einfaches Programmiermodell für den Nutzer. Bewährter Industriestandard. Black-Boxing :
Komposition zur Laufzeit. konsequentes ‘information hiding’. Jede Resource entscheidet nur für sich.
Optimierungspotentiale : Lokale Sub-Coordinatoren. Asynchrones 2PC-Protokoll. Minimierung des Context-Overheads.
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
Probleme…
Um die ACID-Eigenschaften sicherzustellen müssen zumindest für die Dauer des 2PC Locks auf wertvollen Resourcen gehalten werden.
Eine kontrollierte / zuverlässige Umgebung ist Voraussetzung ( typisches Einsatzfeld von CORBA / RMI / DCOM-Anwendungen ).
Unbrauchbar bei unvorhersagbarer Latenzzeit. unbekannter Verfügbarkeit. unkontrollierter Nutzermenge.
Deshalb : OTS über SOAP reicht nicht !
Bu
sin
ess Tra
nsacti
on
s
Mehr Probleme…
Längere Dauer -> erhöhtes Fehlerrisiko. SOAP ist nicht das schnellste Protokoll ! Physikalische Entfernung der Teilnehmer. Mehr Komplexität -> längere Bearbeitung.
Mehr Teilnehmer -> höheres Rollback-Risiko.
Ablehnungswahrscheinlichkeiten summieren sich. ( 0,93 10 < 0,5 )
Time Outs werden wahrscheinlicher. Der Recovery-Fall wird Standard !
Bu
sin
ess Tra
nsacti
on
s
Episode IV: A New Hope
Der Bedarf an Transaktionen bei Web Services ist unumstritten !
Glücklicherweise haben Forscher schon lange darüber nachgedacht.
Es gab Versuche, einen anerkannten Standard für ‘extended Transactions’ zu schaffen.
Z.B. OMG : ‘Activity Service Specification’
OASIS BTP passt am Besten !
Bu
sin
ess Tra
nsacti
on
s
ACID korrodiert !
Aufgabe zumindest der ACI-Eigenschaften.
Atomicity: Die TA überlebt trotz einzelner Fehler / Rollbacks.
Consistency: Durch Verzicht auf langlebige Locks kann die Konsistenz nicht garantiert werden.
Isolation: Teile einer TA können schon vor ihrem Gesamt-Abschluss sichtbar werden.
Bu
sin
ess Tra
nsacti
on
sProblem- / Lösungsbereiche
Persistenz ACID
DB
Bu
sin
ess Tra
nsacti
on
sProblem- / Lösungsbereiche
Persistenz
Verteilung
ACID
DB
XA / OTS
Bu
sin
ess Tra
nsacti
on
sProblem- / Lösungsbereiche
Persistenz
Verteilung
DifferenzierterAusgang
Multi-Protokoll
MinimalesLocking
ACID
DB
XA / OTS
BTP
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
OASIS BTP Spec
Business Transaction Protocolwww.oasis-open.org/committees/business-
transactions
Kick Off : 13. 03. 2001
Termin 1.0 : Ende Dezember ?
Bu
sin
ess Tra
nsacti
on
sOASIS BTP Technical Committee
– BEA Systems, Inc.
– Bowstreet, Inc.
– Choreology Ltd.
– Entrust, Inc.
– Hewlett-Packard Co.
– Interwoven Inc.
– IONA Technologies PLC
– SeeBeyond Inc.
– Sun Microsystems Computer Corp.
– Talking Blocks Inc.
Bu
sin
ess Tra
nsacti
on
s
Business Transaction Protocol
BTP ist ein Inter-Operation Protokoll, das definiert, wie sich transaktionale (Web) Services zu verhalten haben.
Und es wird festgelegt, welche Nachrichten während einer Transaktion ausgetauscht werden.
Basis ist das 2PC für kleine ( lokale ) Teile, die zu größeren, nicht-ACID Transaktion zusammengefügt werden.
Die Spezifikation definiert keine API !( siehe aber JSR 156 )
Einige Firmen haben Implementierungen zugesagt, bzw. haben Demos fertig:
HP Choreology/Bowstreet TalkingBlocks BEA ...
Bu
sin
ess Tra
nsacti
on
s
BTP – Anforderungen
Mehrere erfolgreiche Ausgänge einer Transaktion sind zulässig.
Auswirkungen von Operationen müssen nicht isoliert / dauerhaft sein.
Transaktionsteilnehmer können zeitweise unerreichbar sein.
Kommunikation basierend auf XML. Verschiedene Transportprotokolle sind
zulässig.
Bu
sin
ess Tra
nsacti
on
s
Begriffe : Atom / Cohesion
Ein Atom ist die BTP Bezeichnung für eine ‘Standard’ -Transaction ( atomar ).
Innerhalb eines Atoms gelten die Regeln des bekannten 2PC. Der Ausgang eines Atoms ist Alles-Oder-Nichts.
Atome können zu Cohesions aggregiert werden.
Business-Regeln bestimmen den Ausgang einer Cohesion in Bezug auf den Ausgang der zugrundeliegenden Atomen.
Bu
sin
ess Tra
nsacti
on
s
Coordinator
Atome werden von einem Coordinator gesteuert. ‘In Process’ : die Applikation steuert selbst. ‘Out of Process’ : ein spezieller Dienst
übernimmt die Coordinator-Aufgabe. Im Inter-Enterprise-Bereich bietet sich eine
‘Trusted-Coordinator’-Dienstleistung an. Der Coordinator muss fehler-tolerant sein:
Das Ergebnis muss im Stable Storage gesichert sein, bevor es an die einzelnen Teilnehmer propagiert wird.
Im Recovery-Fall dient das Log als Basis für das ‘replay completion’ der koordinierten Transaktion.
Bu
sin
ess Tra
nsacti
on
s
Atom Example
Atom
Client Application
CoordinatorCredit CardClearance
Book Shop
Bu
sin
ess Tra
nsacti
on
s
Atom3
Coordinator Hierarchien
Coordinator 1
Atom2Atom1
Atom5Atom4
Atom7Atom6
Bu
sin
ess Tra
nsacti
on
s
Atom3
Coordinator Hierarchien
Coordinator 2
Coordinator 1
Atom2
Coordinator 3
Coordinator 4
Atom1
Atom5Atom4
Atom7Atom6
Bu
sin
ess Tra
nsacti
on
sAtomare Gesetzmäßigkeiten
Der Atom Coordinator ist reaktiv Prepare und Commit des Coordinators ( damit
des Atoms ) werden von ‘aussen’ gesteuert. Beliebige Blockierung von Resourcen möglich.
Die Atoms können ihr Vote ‘qualifizieren’ : Zeitangabe, wie lange ein Atom bereit ist, auf
das Commit zu warten. Danach : Einseitige Annahme über den
AusgangUnilateral confirm / cancel.
Mehrfaches Prepare pro Atom ist zulässig. Rücksetzen der Time-Outs.
Bu
sin
ess Tra
nsacti
on
sComposer = Cohesion Manager
Der Composer übernimmt die Steuerung der Cohesions ( nicht-atomaren Business TA ).
In-Process / Out-Of-Process. Make Or Buy ( / Use ). Der Composer entscheidet über den Ausgang
der nicht-atomaren TA anhand des Ausgangs der zugeh. Atoms und der Business Logik.
Durch Composer als Teilnehmer an einer Cohesion kann ein Baumstruktur erzeugt werden.
Ein subordinate Composer verhält sich nach aussen wie ein Atom.
Bu
sin
ess Tra
nsacti
on
s
BTP Schichten
AnwendungAnwendung
Cohesion Cohesion ComposerComposer
Atom Atom CoordinatorCoordinator
ACID Resource ACID Resource
Bu
sin
ess Tra
nsacti
on
s
Cohesion
Cohesion
Cohesion Composer
Client Application
Atom 1 Atom 2 Atom N
Bu
sin
ess Tra
nsacti
on
s
Cohesion = Businesslogik
Cohesion
Composer
Application
Atom A1 Atom A2 Atom AN
ConfirmCancelCancel
(A1=Cancel, A2=Cancel, AN=Cancel)
Bu
sin
ess Tra
nsacti
on
s
Atom3
Cohesion Hierarchien
Cohesion 2
Cohesion 1
Atom2
Cohesion 3
Cohesion 4
Atom1
Atom5Atom4
Atom7Atom6
Bu
sin
ess Tra
nsacti
on
s Atom
Atom Demo: Organising a Night Out
Application Message
BTP Message
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
SOAP
WebRestaurant Participant
WebRestaurant Participant
SOAP
SOAPSOAP
SOAP
Bu
sin
ess Tra
nsacti
on
sAtom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Create Atom
Atom ID
Create AtomAtom ID
WebRestaurant Participant
WebRestaurant Participant
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Book Taxi
Enrol
Book Taxi
Enrol
Application Message !
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Book Table
WebRestaurant Participant
WebRestaurant Participant
Enrol
Enrol
Book Table
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Book Seats
WebRestaurant Participant
WebRestaurant Participant
Enrol
EnrolBook Seats
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
PreparePrepare
PreparePrepare
Prepare
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Vote confirmVote confirm
Vote confirm
Vote confirm
Vote confirm
Vote confirm
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
ConfirmConfirm
ConfirmConfirm
Confirm Confirm
Bu
sin
ess Tra
nsacti
on
s
Oder…
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
PreparePrepare
PreparePrepare
Prepare
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Vote confirmVote confirm
Vote cancel
Vote cancel
Vote confirm
Vote confirm
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
CancelCancel
Cancel
Bu
sin
ess Tra
nsacti
on
s
Atom ID
Atom Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Atom cancelled
Atom cancelled
Bu
sin
ess Tra
nsacti
on
s
Weniger ‘Kultur’ ...
Cohesions erlauben die ‘Aufweichung’ der ACID-Anforderung.
Die Buchung der Theaterkarten wird als ‘nice to have’ eingestuft.
Die Transaktion kann trotzdem zu einem erfolgreichen Abschluss kommen.
Ohne Abendessen geht es aber nicht !
Bu
sin
ess Tra
nsacti
on
s
Cohesion
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Create Cohesion
Cohesion ID
Create CohesionCohesion ID
WebRestaurant Participant
WebRestaurant Participant
Bu
sin
ess Tra
nsacti
on
s
Cohesion
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Create Atom, associate withCohesion
Atom 1
Create Atom,associate withCohesion
Atom 1
WebRestaurant Participant
WebRestaurant Participant
Bu
sin
ess Tra
nsacti
on
s Cohesion
Atom 1
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Book Taxi
Enrol(Atom 1)
Book Taxi
Enrol(Atom 1)
Bu
sin
ess Tra
nsacti
on
s
Atom 1
Cohesion
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Book Table
WebRestaurant Participant
WebRestaurant Participant
Enrol(Atom 1)
Enrol(Atom 1)
Book Table
Bu
sin
ess Tra
nsacti
on
sCohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Create Atom, associate withCohesion
Atom 2
Create Atom,associate withCohesion
Atom 2
WebRestaurant Participant
WebRestaurant Participant
Cohesion
Bu
sin
ess Tra
nsacti
on
s
Atom 2
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Book Seats
WebRestaurant Participant
WebRestaurant Participant
Enrol(Atom 2)
Enrol(Atom 2)
Book Seats
Cohesion
Bu
sin
ess Tra
nsacti
on
sCohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Prepare
WebRestaurant Participant
WebRestaurant Participant
Prepare
Cohesion
Bu
sin
ess Tra
nsacti
on
s
Atom 1
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
PreparePrepare
Prepare
Cohesion
Bu
sin
ess Tra
nsacti
on
s
Atom 1
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Vote confirmVote confirm
Voteconfirm
Cohesion
Voteconfirm
Bu
sin
ess Tra
nsacti
on
s
Atom 2
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Prepare
Prepare
Cohesion
Bu
sin
ess Tra
nsacti
on
s
Atom 2
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
Vote cancel
Vote cancel
Cohesion
Bu
sin
ess Tra
nsacti
on
sCohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
PrepareAtom 1: confirmAtom 2: cancel
WebRestaurant Participant
WebRestaurant Participant
Cohesion
PrepareAtom 1: confirmAtom 2: cancel
Bu
sin
ess Tra
nsacti
on
sCohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
Confirm
WebRestaurant Participant
WebRestaurant Participant
Cohesion
Confirm
Bu
sin
ess Tra
nsacti
on
s
Atom 1
Cohesion Demo: Organising a Night Out
Client Application
Client Application
SOAP server
SOAP server
SOAP server
SOAP server
BTP ServiceBTP Service
SOAP server
SOAP server
WebTaxi Participant
WebTaxi Participant
WebTheatre Participant
WebTheatre Participant
SOAP server
SOAP server
WebRestaurant Participant
WebRestaurant Participant
ConfirmConfirm
Confirm
Cohesion
Bu
sin
ess Tra
nsacti
on
s
Taxi
Night Out Beispiel : Ergebnisse
Atom 1
Cohesion
Restaurant Theatre
Atom 2
Bu
sin
ess Tra
nsacti
on
s
Ausgang der Transaktion
‚Commited‘ ‚Rollbacked‘
Klassisches 2 PC
Bu
sin
ess Tra
nsacti
on
s
Ausgang der Transaktion
‚Commited‘ ‚Rollbacked‘
Klassisches 2 PC
BTP Outcome
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
BTP Messaging
BTP SOAP Binding hat höchste Priorität.
BTP messages basieren nicht auf SOAP-RPC.
Das BTP SOAP Binding nutzt kein WSDL.
Die Umfang der BTP Messages ist beachtlich gross.
RTFM.
Bu
sin
ess Tra
nsacti
on
s
BTP Messaging :‘Prepare’
PREPARE
<btp:prepare id?> <btp:target-additional-information> ...additional address information... </btp:target-additional-information> <btp:inferior-identifier>...hexstring...</btp:inferior-identifier> ? <btp:reply-address> ? ...address... </btp:reply-address> <btp:transaction-identifier>...hexstring...</btp:transaction-identifier> ? <btp:inferiors-list> ?
<btp:inferior-handle>...hexstring...</btp:inferior-handle> + </btp:inferiors-list> <btp:qualifiers> ? ...qualifiers... </btp:qualifiers></btp:prepare>
Bu
sin
ess Tra
nsacti
on
s
BTP Messaging : SOAP<soap:Envelope xmlns:soap=... > <soap:Header> <btp:messages xmlns:btp="urn:oasis:names:tc:BTP:xml"> <btp:context superior-type="atom"> <btp:superior-address> <btp:binding>soap-http-1</btp:binding> <btp:binding-address>http://example.com/soaphandler</btp:binding-address> <btp:additional-information>btpengine</btp:additional-information> </btp:superior-address> <btp:superior-identifier>1001</btp:superior-identifier> <btp:qualifiers> ... </btp:qualifiers> </btp:context> </btp:messages> </soap:Header>
<soap:Body> <ns1:orderGoods xmlns:ns1=...> <custID>ABC8329045</custID> <itemID>224352</itemID> <quantity>5</quantity> </ns1:orderGoods> </soap:Body></soap:Envelope>
Bu
sin
ess Tra
nsacti
on
s
BTP Messaging : SOAP<soap:Envelope xmlns:soap=... > <soap:Header> <btp:messages xmlns:btp="urn:oasis:names:tc:BTP:xml"> <btp:context superior-type="atom"> <btp:superior-address> <btp:binding>soap-http-1</btp:binding> <btp:binding-address>http://example.com/soaphandler</btp:binding-address> <btp:additional-information>btpengine</btp:additional-information> </btp:superior-address> <btp:superior-identifier>1001</btp:superior-identifier> <btp:qualifiers> ... </btp:qualifiers> </btp:context> </btp:messages> </soap:Header>
<soap:Body> <ns1:orderGoods xmlns:ns1=...> <custID>ABC8329045</custID> <itemID>224352</itemID> <quantity>5</quantity> </ns1:orderGoods> </soap:Body></soap:Envelope>
Bu
sin
ess Tra
nsacti
on
s
XA State Table
Bu
sin
ess Tra
nsacti
on
s
Table z@z : Superior state table – normal forward progression
I1 A1 B1 C1 D1 E1 E2 F1 F2receive ENROL/rsp-req A1receive ENROL/no-rsp-req B1receive RESIGN/rsp-req Y1 C1 C1 C1receive RESIGN/no-rsp-req Z Z Z Zreceive PREPARED Y1 E1 E1 E1 F1receive PREPARED/cancel Y1 E2 E2 E2 F1receive CONFIRMED/auto Q1 H1 H1 H1 F1receive CONFIRMED/response F2 F2receive CANCELLED Y1 Z Z J1 J1 K1receive HAZARD P1 P1 P1 P1 P1 P1 P3receive INF_STATE/active/y Y1 A1 B1 D1receive INF_STATE/active B1 D1receive INF_STATE/unknown Z Z Zsend ENROLLED B1send RESIGNED Zsend PREPARE D1 E1 E2send REQUEST_CONFIRMsend CONFIRM F1send CANCELsend CONTRADICTIONsend SUP_STATE/active/y B1send SUP_STATE/active B1send SUP_STATE/preparedin/y E1 E2send SUP_STATE/preparedin E1 E2send SUP_STATE/unknowndecide to request confirm S1 S1 S1decide to prepare D1decide to confirm F1 F1decide to cancel G1 G1 G1 Zremove persistent information Zrecord contradictiondisruption I Z Z Z Z Z Z Z F1disruption II D1 D1disruption III B1 B1disruption IV
State Table ( Auszug )
Table z@z : Superior state table – query after completion and completed states
Y1 Zreceive ENROL/rsp-req Y1receive ENROL/no-rsp-req Y1receive RESIGN/rsp-req Y1 Y1receive RESIGN/no-rsp-req Z Zreceive PREPARED Y1 Y1receive PREPARED/cancel Y1 Y1receive CONFIRMED/auto Q1 Q1receive CONFIRMED/response Z Zreceive CANCELLED Y1 Y1receive HAZARD P2 P2receive INF_STATE/active/y Y1 Y1receive INF_STATE/active Y1 Zreceive INF_STATE/unknown Z Zsend ENROLLED send RESIGNED send PREPARE send REQUEST_CONFIRM send CONFIRM send CANCEL send CONTRADICTION
Table z@z : Superior state table – cancellation and contradiction
G1 G2 G3 G4 H1 J1 K1 L1receive ENROL/rsp-req receive ENROL/no-rsp-req receive RESIGN/rsp-req G3 Z G3 receive RESIGN/no-rsp-req Z Z Z receive PREPARED G1 G2 receive PREPARED/cancel G1 G2 receive CONFIRMED/auto L1 L1 H1 L1receive CONFIRMED/response receive CANCELLED G4 Z G4 J1 K1 receive HAZARD P4 P4 receive INF_STATE/active/y G1 G2 receive INF_STATE/active G1 G2 receive INF_STATE/unknown Z Z Z Z send ENROLLED send RESIGNED send PREPARE send REQUEST_CONFIRM send CONFIRM send CANCEL G2 G2 Z Z send CONTRADICTION send SUP_STATE/active/y send SUP_STATE/active send SUP_STATE/preparedin/y send SUP_STATE/preparedin send SUP_STATE/unknown decide to request confirm decide to prepare decide to confirm F1 K1 decide to cancel L1 G4 remove persistent information record contradiction R1 R1disruption I Z Z Z Z Z Z F1 Zdisruption II G2 G2 E1 E1 G2disruption III D1 D1 disruption IV B1 B1
Table z@z : Superior state table – hazard and request confirm
P1 P2 P3 P4 Q1 R1 R2 S1receive ENROL/rsp-req receive ENROL/no-rsp-req receive RESIGN/rsp-req C1receive RESIGN/no-rsp-req Zreceive PREPARED S1receive PREPARED/cancel S1receive CONFIRMED/auto Q1 R1 R1 S1receive CONFIRMED/response Z R2 Zreceive CANCELLED R1 R1 Zreceive HAZARD P1 P2 P3 P4 R1 R1 Zreceive INF_STATE/active/y S1receive INF_STATE/active S1receive INF_STATE/unknown P1 P2 P4 R2 R2 Zsend ENROLLED send RESIGNED send PREPARE send REQUEST_CONFIRM S1send CONFIRM send CANCEL send CONTRADICTION R2 send SUP_STATE/active/y send SUP_STATE/active send SUP_STATE/preparedin/y send SUP_STATE/preparedin send SUP_STATE/unknown decide to request confirm decide to prepare decide to confirm decide to cancel remove persistent information Z record contradiction R1 R1 R1 R1 R1 disruption I Z Z Z Z Z R1 Zdisruption II D1 F1 G2 disruption III B1 disruption IV
Bu
sin
ess Tra
nsacti
on
s
Java Binding
JSR 156XML Transactioning API for Java ‚JAXTX‘
Initiiert von HP ( Mark Little ), IBM, IONA,und Choreology.
Abstimmung über den Specification Request am 5.11.2001.
Erwartete Fertigstellung : Sommer 2002
Bu
sin
ess Tra
nsacti
on
s
Related ...
XAML Transaction Authority Markup Language deprecated
ebXML High Level, Ebene Geschäftslogik. Nicht Fehlertolerant.
WSFL Skript-basierte Steuerung von Web Services. Nicht Transaktional.
Bu
sin
ess Tra
nsacti
on
s
Agenda
Einführung
Grundlagen Transaktionen
Zwei Welten: web services / ACID
Business Transaction Protocol (BTP)
SOAP, ebXML, usw.
Zusammenfassung
Bu
sin
ess Tra
nsacti
on
s
Zusammenfassung
Transaktionen sind ein entscheidender Baustein für das zuverlässige Durchführen von nicht-trivialen Prozessen.
BTP ist die Lösung für transaktionale Web Services.
Freiheit zur Komposition von Prozessen aus ACID- und nicht-ACID Teilnehmern
Die Geschäftslogik entscheidet über den Ausgang der Transaktion, nicht die starre Infrastruktur.
Die Spezifikation ist ( fast ) fertig, der Weg ist frei für Implementierungen.
Bu
sin
ess Tra
nsacti
on
s
Resourcen
OASIS BTP:http://www.oasis-open.org/committees/business-transactions
OMG OTS Spec:http://www.omg.org/technology/documents/formal/transaction_service
JAXTX JSR 156:http://www.jcp.org/jsr/detail/156.jsp
HP XTS Software:http://www.arjuna.com/xts/
Choreology :http://www.choreology.com/~btp/
KLuPhttp://www.klup.de