LongRunningTransactionsinServiceOriented Environments infm3::SR - - PowerPoint PPT Presentation

long running transactions in service oriented environments
SMART_READER_LITE
LIVE PREVIEW

LongRunningTransactionsinServiceOriented Environments infm3::SR - - PowerPoint PPT Presentation

LongRunningTransactionsinServiceOriented Environments infm3::SR MartinGerlach martin.gerlach@informatik.hawhamburg.de 16.12.2005 Needforconsistencyofbusinesscriticaldata


slide-1
SLIDE 1

16.12.2005

LongRunningTransactionsinServiceOriented Environments

infm3::SR MartinGerlach martin.gerlach@informatik.hawhamburg.de

slide-2
SLIDE 2

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 2

Needforconsistencyofbusinesscriticaldata

  • … asalways,acrossevolvingtechnologies
  • Combinationofcoordination/compositiontechniques

(workflow)[sinceearly90ies]withlooselycoupled services[thisdecade]

  • Distributedapplications[since"sometimelongago"]
  • Mobileapplications[moreandmore,recently]
  • EAI+B2B
  • Services/SOA/<insertmorebuzzwordshere>fitwell
  • Nothinggroundbreakingly new,butsuccessfulapplication

innumerousprojects

  • Manylessonslearnt
slide-3
SLIDE 3

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 3

Noteworthyhistoricalfacts(1)

  • 6000yearsago,Sumer:

Royalinventoryoftaxes, land,grain,cattle,etc.on claytablets

  • Recordskeptforevery

transaction

  • …papyrus,…,paper…
  • 1890useofpunchcard

systemtoreportUScensus byHermanHollerith

  • From≈1950
  • Batch(offline)transactions
  • Followedbyonline

transactions(OLTP)

slide-4
SLIDE 4

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 4

Noteworthyhistoricalfacts(2)

JimGray,1981: TheTransactionConcept– VirtuesandLimitations

  • Purpose:Thereareno"perfectsystems",soweneedtomake"almost

perfect"systemssafe(r),i.e.faulttolerant

  • ACIDTransactions:Activitiescomposedofactionsofdifferentcriticality
  • Realization:Updateinplace,TimeDomainAddressing,Loggingand

Locking,UNDO/REDO,etc.

  • Firstundo/redolog:Hänsel andGretel☺ … alsofirstlogfailure
  • Limitations
  • NestedTransactions
  • Transparentintegrationintoprogramminglanguages
  • PeterPrinciple:"Everyideaisgeneralizedtoitslevelofinapplicability"
slide-5
SLIDE 5

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 5

Thesisoutline::Wherearewetoday?

  • Workingtitle
  • Outline
  • SOA:Fromobjectstocomponentstoservices:

Whyservices?

  • Distributedtransactionsincomponentframeworks
  • Whylong runningtransactions?
  • Existingspecsandongoingresearchwork
  • Conceptualdesignofaframeworkthatsupports

coordinationandlongrunningtransactions

  • Breakingdownthe(somewhatoverloaded)WebServices

relatedspecsandthedesigntotheessentialconcepts

  • Aimatperformance
  • Aimatlimitedresources(mobiledevices)
  • Prototyping(WebServices)

AW1

  • /PJ

PJ Thesis

slide-6
SLIDE 6

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 6

SOA:Whyservices?

  • Whatisneeded?
  • Coarsegranulation
  • Loosecoupling
  • Asynchronous(andreliable)messaging
  • Abstractionfromunderlyingtransportandimplementation
  • Standards
  • Canpreviouslyexistingarchitecturesprovidethis?
  • Functionlibrariesandpackages
  • Classes/Objects
  • Components
slide-7
SLIDE 7

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 7

SOA:Whyservices?::ClassesandComponents

Coarsegranulated Finegranulated CORBA,EJB,JavaBeans,.NET, COM MFC,STL,… ,separatefrom businesslogic,somewellknown Problemdomainspecific ,fewwellknown "Component– Contract– Container"runtimeenvironment Standalone Loosecoupling Tightcoupling "No"persistentstate Stateful (instancevars) NeednotbeOO Objectoriented Describedbyinterface, deploymentdescriptor,contract Describedbyinterface

slide-8
SLIDE 8

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 8

SOA:Whyservices?::Conclusions

  • MappingofServicestoComponents
  • Interface
  • QoS requirements
  • Semantics
  • "Live"inmanagedenvironment(≈Container)
  • Servicesadditionallyprovide
  • Abstractionfromimplementation
  • Abstractionfromtransportandencoding
  • Interoperabilitythroughstandards
  • Atleastagoodidea

WebServicesarchitecturespecificationsprovidea frameworkforrealizationofSOAs

slide-9
SLIDE 9

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 9

SOA:WebServicesFramework

slide-10
SLIDE 10

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 10

Thesisoutline::Wherearewetoday?

  • Workingtitle
  • Outline
  • SOA:Fromobjectstocomponentstoservices:

Whyservices?

  • Distributedtransactionsincomponentframeworks
  • Whylong runningtransactions?
  • Existingspecsandongoingresearchwork
  • Conceptualdesignofaframeworkthatsupports

coordinationandlongrunningtransactions

  • Breakingdownthe(somewhatoverloaded)WebServices

relatedspecsandthedesigntotheessentialconcepts

  • Aimatperformance
  • Aimatlimitedresources(mobiledevices)
  • Prototyping(WebServices)

AW1

  • /PJ

PJ Thesis

slide-11
SLIDE 11

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 11

TXmanagementfundamentals

  • Awholeapplication
  • Distributed(logically,physically,geographically)
  • Heterogeneous
  • WithstringentQoS requirements
  • !
  • Acollectionofoperationsonthephysicalandabstractapplication

state

  • SpecifiesfailuresemanticsforcomputationthroughACID

properties

  • ""!
  • Acollectionofcoreservicesthatmanageandcoordinate

transactions

  • TXmanager,"RPC"manager,[Logging,][Locking,]…
  • "
  • Data,code,processesprovidingaccesstoshareddata
  • ProvidesACIDoperations
slide-12
SLIDE 12

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 12

Application Resource Manager Comm. Manager Transaction Manager Resource Manager Resource Manager Resource Manager Comm. Manager Server Transaction Manager App Data Begin, Commit Rollback Tx id leaving Prepare, Commit, Abort Requests Requests Prepare, Commit, Abort Start App Data Remote Requests prepare, commit, abort +ack, -ack, restart Tx id arriving TX [X/Open DTP] RM specific [various, e.g. SQL] "RPC..." "...RPC" RM specific [various, e.g. SQL] OSI/TP and CCR [ISO] XA XA [X/Open DTP] XA+ [X/Open DTP] Resource Manager Resource Manager Resource Manager Resource Manager Join tx Join tx

TXmanagementfundamentals::X/OpenDTP

slide-13
SLIDE 13

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 13

TXmanagementfundamentals

  • TXmodels(AW1recap)
  • Flat
  • Flat,distributed(splitsintoTXoneachparticipatingnode)
  • Flatwithsavepoints (partialrollback)
  • Chained
  • Nested
  • Multilevel
  • Opennested
  • Longlivedwithcompensationandcontextmanagement
  • TXprocessingmodels
  • Direct,synchronous
  • Queued,asynchronous
  • Compensationbased,both,usingextramiddleware
slide-14
SLIDE 14

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 14

CORBAObjectTransactionService(OTS)

  • ObjectManagementArchitecture(OMA)specifiessyntax

(IDL)andsemantics(Englishtext)for

  • ORB
  • CORBAservices
  • Naming,Event,,Security,…
  • CORBAfacilities
  • Vertical(industries)
  • Horizontal(utilities,internationalization,time,…)
  • OTS
  • DevelopedbygroupincludingeverymajorTPvendor
  • ExtendstransactionalsemanticstoOOapplications
  • Integrationofobjectandnonobjecttx systems
  • >12implementationsin2000
  • Flat(mandatory)andnested(optional)tx models
  • InteroperablewithX/OpenDTPmodel(TX,XA,OSI/TP)
slide-15
SLIDE 15

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 15

OTS Implementation Transactional Client Resource Request incl. PropagationContext Available Interfaces Current TransactionFactory Control Terminator Coordinator Current Control Coordinator Resource SubtransactionAwareResource Transaction Context Transaction Context Associated with thread Associated with thread Transactional Object Recoverable Object Recoverable Server Transactional Server Begin, commit, rollback Register res. Participate TX XA

CORBAOTS::ArchitectureandAPI

slide-16
SLIDE 16

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 16

OTS Implementation Transactional Client Resource Request incl. PropagationContext Available Interfaces Current TransactionFactory Control Terminator Coordinator Current Control Coordinator Resource SubtransactionAwareResource Transaction Context Transaction Context Associated with thread Associated with thread Transactional Object Recoverable Object Recoverable Server Transactional Server Begin, commit, rollback Register res. Participate TX XA

CORBAOTS::ArchitectureandAPI

interface Current : CORBA::Current { void begin(); void commit(); void rollback(); Status get_status(); void rollback_only(); Control get_control(); Control suspend(); void resume(Control); };

slide-17
SLIDE 17

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 17

OTS Implementation Transactional Client Resource Request incl. PropagationContext Available Interfaces Current TransactionFactory Control Terminator Coordinator Current Control Coordinator Resource SubtransactionAwareResource Transaction Context Transaction Context Associated with thread Associated with thread Transactional Object Recoverable Object Recoverable Server Transactional Server Begin, commit, rollback Register res. Participate TX XA

CORBAOTS::ArchitectureandAPI

interface TransactionFactory { Control create(…); }; interface Terminator { void commit(); void rollback(); }; interface Control { Terminator get_terminator(); Coordinator get_coordinator(); };

slide-18
SLIDE 18

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 18

OTS Implementation Transactional Client Resource Request incl. PropagationContext Available Interfaces Current TransactionFactory Control Terminator Coordinator Current Control Coordinator Resource SubtransactionAwareResource Transaction Context Transaction Context Associated with thread Associated with thread Transactional Object Recoverable Object Recoverable Server Transactional Server Begin, commit, rollback Register res. Participate TX XA

CORBAOTS::ArchitectureandAPI

interface Coordinator { Status get_status(); RecoveryCoordinator register_resource(Resource); void register_synchronization(Synchronization); Control create_subtransaction(…); void rollback_only(…); PropagationContext get_txcontext(); }; interface Synchronization : TransactionalObject { void before_completion(); void after_completion(Status); };

slide-19
SLIDE 19

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 19

OTS Implementation Transactional Client Resource Request incl. PropagationContext Available Interfaces Current TransactionFactory Control Terminator Coordinator Current Control Coordinator Resource SubtransactionAwareResource Transaction Context Transaction Context Associated with thread Associated with thread Transactional Object Recoverable Object Recoverable Server Transactional Server Begin, commit, rollback Register res. Participate TX XA

CORBAOTS::ArchitectureandAPI

interface Resource { Vote prepare(); void rollback(); void commit(); void commit_one_phase(); void forget(); };

slide-20
SLIDE 20

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 20

J2EEJavaTransactionService(JTS)

  • BasedonOTS1.1
  • TransactionalObject interfaceusedtodeclare

transactionality,notPOApolicies

  • UsesIIOPforRMI
  • PartofmostJ2EEApplicationServers
slide-21
SLIDE 21

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 21

J2EEJTS::JavaTransactionAPI(JTA)

package javax.transaction package javax.transaction.xa

slide-22
SLIDE 22

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 22

J2EEJTS::JavaTransactionAPI(JTA)

interface UserTransaction { void begin(); void commit(); int getStatus(); void rollback(); void setRollbackOnly(); void setTransactionTimeout(int); }; package javax.transaction package javax.transaction.xa

slide-23
SLIDE 23

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 23

J2EEJTS::JavaTransactionAPI(JTA)

package javax.transaction package javax.transaction.xa interface TransactionManager { void begin(); void commit(); int getStatus(); Transaction getTransaction(); void resume(Transaction); void rollback(); void setRollbackOnly(); void setTransactionTimeout(int); Transaction suspend(); };

slide-24
SLIDE 24

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 24

J2EEJTS::JavaTransactionAPI(JTA)

package javax.transaction package javax.transaction.xa interface Transaction { void begin(); void commit(); boolean delistResource(XAResource); boolean enlistResource(XAResource); int getStatus(); void registerSynchronization( Synchronization); void rollback(); void setRollbackOnly(); }; interface Synchronization { void beforeCompletion(); void afterCompletion(int status); };

slide-25
SLIDE 25

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 25

J2EEJTS::JavaTransactionAPI(JTA)

package javax.transaction package javax.transaction.xa interface XAResource { void commit(Xid, boolean); void end(Xid); void forget(Xid); int getTransactionTimeout(); boolean isSameRM(XAResource); int prepare(Xid); Xid[] recover(); void rollback(Xid); boolean setTransactionTimeout(int); void start(Xid); };

slide-26
SLIDE 26

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 26

J2EEJTS::TransactionalJ2EEcomponents

  • EJBs
  • SimilartobasiclevelCORBA3components
  • MethodsontheEJBinterfacecanbetransactional
  • Beanmanaged:ThroughJTAUserTransaction
  • Containermanaged:Throughdeploymentdescriptoratmethod

level

  • NotSupported

[none -> none][T1 -> none]

  • Required

[none -> T2 ][T1 -> T1 ]

  • Supports

[none -> none][T1 -> T1 ]

  • RequiresNew

[none -> T2 ][T1 -> T2 ]

  • Mandatory

[none -> ERR ][T1 -> T1 ]

  • Never

[none -> none][T1 -> ERR ]

  • EJBContainerdoesnotneedtouseaJTSimplementation,but

mustprovideJTA

  • JDBC+JMSproviders
  • Actasresourcemanagers
  • MustimplementJTAXAinterface
slide-27
SLIDE 27

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 27

Thesisoutline::Wherearewetoday?

  • Workingtitle
  • Outline
  • Conceptualdesignofaframeworkthatsupports

coordinationandlongrunningtransactions

  • Whylongrunningtransactions?(AW1recap)
  • Requirements
  • Specs:WSC,WSBA
  • Relatedwork
  • Initialideas
  • Projectexperiences
  • Outlook

Thesis

slide-28
SLIDE 28

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 28

Whylongrunningtransactions?(AW1recap)

  • SomeactivitiesintheTXcantakelong
  • NosatisfyingQoS guaranteescanbemade
  • Participantsareunabletoperform2PC
  • Participantsmustnotholdlocksfortoolong
  • ACIDistoorestrictive
  • Participatingresourcemanagersshouldcommitassoon

aspossible

  • #$…therentalcarshouldnotstaybookedifthe

restaurantissoldout…

  • Coordinationandcompensationhandlingrequired
slide-29
SLIDE 29

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 29

Requirements

  • %&!
  • '
  • Heterogeneous
  • CompensationbasedTXprocessing(CTP)
  • Resourcemanagerlogging
  • But"no"locking
  • Commutativeactions
  • (
  • ')*(
  • +,-.
  • /
  • Idempotentactionsincaseofunreliablemessaging
  • …fromcontextinpersistentstorage
  • ")'-
  • AOP(injection,codegenerationatruntime)
  • vs Dynamic
  • Policiesandimplementedinterfaces
slide-30
SLIDE 30

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 30

Requirements

  • %&!
  • '
  • Heterogeneous
  • CompensationbasedTXprocessing(CTP)
  • Resourcemanagerlogging
  • But"no"locking
  • Commutativeactions
  • (
  • ')*(
  • +,-.
  • /
  • Idempotentactionsincaseofunreliablemessaging
  • …fromcontextinpersistentstorage
  • ")'-
  • AOP(injection,codegenerationatruntime)
  • vs Dynamic
  • Policiesandimplementedinterfaces

complete Coordinator Participant cancel

!

"self-compensate"

slide-31
SLIDE 31

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 31

Specifications

Generic,interop., sep.C/T,complete, nestedscopes Short,easy, generic,interoper., separationofC/T Complete,well formed

  • Prettylong;)

Incomplete,flat NolegacyTXintegr. "Bus./TXLogicMix"

  • OASISsince10/2003

OASISsince10/2005 (!) OASISsince03/2001, butalmostabandoned

  • &'

#& #'

1!

  • ACIDTransaction

(2PC)

AtomicTransaction

(3protocols,incl.2PC)

Atom

(Opentop2phasecompl.)

' (seenextslide) Coordinator, Participant Superior,Inferior

  • WSCTX(59),

WSCF(63), WSTXM(111) WSC(23), WSAT(21), WSBA(23) BTP(163) ! Arjuna,Fujitsu,IONA, Oracle,Sun IBM,Microsoft HP,Oracle,BEA

  • 2003

2002 2001

  • '2

, #

slide-32
SLIDE 32

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 32

Specifications

Generic,interop., sep.C/T,complete, nestedscopes Short,easy, generic,interoper., separationofC/T Complete,well formed

  • Prettylong;)

Incomplete,flat NolegacyTXintegr. "Bus./TXLogicMix"

  • OASISsince10/2003

OASISsince10/2005 (!) OASISsince03/2001, butalmostabandoned

  • &'

#& #'

1!

  • ACIDTransaction

(2PC)

AtomicTransaction

(3protocols,incl.2PC)

Atom

(Opentop2phasecompl.)

' (Hierarchical) Coordinator, Participant Superior,Inferior

  • WSCTX(59),

WSCF(63), WSTXM(111) WSC(23), WSAT(21), WSBA(23) BTP(163) ! Arjuna,Fujitsu,IONA, Oracle,Sun IBM,Microsoft HP,Oracle,BEA

  • 2003

2002 2001

  • '2

, #

Participant CoordinatorParticipant ParticipantCoordinator ParticipantRespondant ServiceCoordinator ServiceRespondant ClientCoordinator ClientRespondant RecoveryCoordinator

slide-33
SLIDE 33

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 33

WSCoordination

protocol Operation (w/ CoordinationContext) RegisterResponse Register CreateResponse protocol Coordinator Participant Registration Registration Activation Service Client Create Register Operation Response Coordination Service Coordination Service

slide-34
SLIDE 34

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 34

WSCoordination

protocol Operation (w/ CoordinationContext) RegisterResponse Register CreateResponse protocol Coordinator Participant Registration Registration Activation Service Client Create Register Operation Response Coordination Service Coordination Service

<soap:Header> <wscoor:CoordinationContext soap:mustUnderstand="true"> <wscoor:Identifier> http://www.informatik.haw-hamburg.de/ws/#8237123801 </wscoor:Identifier> <wscoor:CoordinationType> http://schemas.xmlsoap.org/ws/2004/10/wsba/AtomicOutcome </wscoor:CoordinationType> <wscoor:RegistrationService> <wsa:Address> http://host/service </wsa:Address> </wscoor:RegistrationService> </wscoor:CoordinationContext> </soap:Header>

slide-35
SLIDE 35

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 35

WSBusinessActivity

Completed Completed Close Close Close Completed Complete Exited Complete Complete Complete Participant 1 Participant 2 Participant 3 Coordinator Exit Participant 4 Closed Closed Closed

slide-36
SLIDE 36

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 36

WSBusinessActivity withcompensation

Completed Completed Canceled Compensated Compensate Compensate Cancel Faulted Complete Complete Complete Participant 1 Participant 2 Participant 3 Coordinator Fault Participant 4 Compensated

slide-37
SLIDE 37

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 37

Relatedwork

  • JSR95:J2EEActivityServiceforExtendedTransactions
  • "JTAforlongrunningtransactions"basedonOMGActivityService
  • Activities=unitsofwork,potentiallydistributed,neednotbe transactional
  • JSR156:JavaAPIforXMLTransactions(JAXTX)
  • SupportforJTA,J2EEActivityService,BTP,WST,WSTXM
  • Purpose:Providecommoninterfacefordifferenttx implemenations
  • ApacheKandula
  • BasedonApacheAxis2
  • SubversionBranchKandula_1(Early2005)
  • WSATonly
  • MappingofCoordinationContext identifiertoJTAUserTransaction inAxisHandler
  • TestedwithJBoss andJOTMtx managers
  • Subversiontrunk
  • Significantlychangedandchanging
  • NoJTAcodesofar
  • Seemstobearefactoring effortonKandula_1
  • StillnoWSBAcode
  • EJB2.1WebServiceEndpointEJBs
  • StatelessSessionBeans
  • TXsupportforlocalJTAtransactionsonly(Mandatory notallowed!)
slide-38
SLIDE 38

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 38

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

slide-39
SLIDE 39

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 39

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

create

Incoming call toService 1transactional operation

slide-40
SLIDE 40

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 40

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

(context) (context) (context)

Call from transactional

  • peration toService2
slide-41
SLIDE 41

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 41

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

register(context) create create regResp(context)

Service2registration at Service1

1 2 3 4 5 6 7 8 9(actual business method)

slide-42
SLIDE 42

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 42

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

(context) (context) (context)

Service2response to Service1

slide-43
SLIDE 43

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 43

Initialideas::Conceptualoverview/Architecture

Service1 PParticipant Service2 Coordinator QoS/Transaction Application TXMiddleware TXMiddleware Call implementation Service1 Skeleton Service2 Skeleton Service2 Stub Service1 Stub CParticipant

complete complete/close(ctx) completed/closed(ctx) update update

Service1completes the transaction (2phases)

1 2 3,11 4,12 5 13 7,16 8,17 9,18 10,19 6,14 15 20

slide-44
SLIDE 44

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 44

Initialideas::Notes

  • Asynchronouscallhandling
  • Modelservicesandprotocolsasstatemachines,persiststateafter

eachoperation

  • Registryforcontexts,coordinators,participants,operationcall

backs,…

  • Onestatemachineperserviceandpercoordinator/participantpair
  • Transparency
  • Hideasmuchprotocolprocessingaspossiblefromdevelopers
  • Somecompletionsemanticsmaydependonbusinesslogic
  • Needtoexposeoperationsoncoordinator/participantsforservice

managedtx

  • Use/extendcodegeneration(e.g.AxisWSDL2Java)
  • LikeEJB:Containermanagedtx,Servicemanagedtx
  • GeneratedcodecoulduseJAXTX
  • Generatedcode(possibly)differentforeachservicerole
  • Coordinator/participant/coordinationtype/protocoltype/operation
slide-45
SLIDE 45

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 45

Projectexperiences/Outlook

  • Project:Theusualdifficulties
  • Technical
  • NewtoJBoss
  • Setupofdevelopmentenvironmentwithdebugging,SOAPmonitor,…
  • WebServicescontainer(Axis1.2.1)issues
  • Logistical
  • Notenoughtimetoproducemeaningfulresults
  • HadtorevisequiteafewTX/J2EE/WebServicesconcepts
  • Lowertargetswouldnothavemademuchsense,butmaybethreeto

fourmotivatedpeopleas"TXteam"

  • Project:Successes(by01/2006)
  • "Rapidly"(nettime)prototypedactivation,registration,participant

initiatedBAcompletionwithmixedoutcome

  • Foundationforaframeworkprototypewithcodegeneration
  • Outlook
  • Project:IntegrationconceptwithESBandSecurity
  • Thesis:Detailedframeworkdesign
  • Thesis:"TXLite"frameworkfordeviceswithlimitedresources
slide-46
SLIDE 46

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 46

34

  • 35
  • Gray,Reuter,6

7,MorganKaufman,1993

  • Szyperski,*)6#89

,AddisonWesley,1998

  • Siegel,#':2,

OMGPress,2000

  • Pavlik,Maron,Little,;,

PrenticeHall,2004

  • Weerawarana,Curbera,Leymann,Storey,Ferguson,

8*',Pearson,2005

  • …plusseveralarticlesandpapers(seereport)
slide-47
SLIDE 47

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 47 public class MySessionEJB implements SessionBean { EJBContext ejbContext; public void someMethod(...) { javax.transaction.UserTransaction ut; DataSource ds; Connection dcon; Statement stmt; QueueConnectionFactory qcf; QueueConnection qcon; Queue q; QueueSession qsession; QueueSender qsender; Message message; // obtain db conn and queue session objects through JNDI InitialContext lookup ... // Now do a transaction that involves the two connections. ut = ejbContext.getUserTransaction(); // start the transaction ut.begin(); // Do database updates and send message. The container automatically enlists // dcon and qsession with the transaction. stmt.executeQuery(...); stmt.executeUpdate(...); stmt.executeUpdate(...); message = qsession.createTextMessage(); message.setText(“some message”); qsender.send(message); // commit the transaction ut.commit(); // release connections stmt.close(); qsender.close(); qsession.close(); dcon.close(); qcon.close(); } ... }

J2EEJTS::TransactionalJ2EEcomponents::EJBwith beanmanagedtransactioncodesample

slide-48
SLIDE 48

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 48

J2EEJTS::TransactionalJ2EEcomponents

commit begin enlist XA Resource with Tx delist XA Resource from Tx close update dispatch to business method EJB Container TX Service EJB App Server Connection Proxy XA Resource XA Start XA End commit prepare

slide-49
SLIDE 49

16.12.2005 infm3::SR::LongRunningTransactions...::MartinGerlach 49

Excursus:Experiences@Techniker Krankenkasse

  • Formbasedcasemanagementsystem
  • Problems
  • 2PCnotsupportedbymanysystems(e.g.SAP)
  • Distributedtx notsupportedbymany(legacy)systems
  • TXmanageroverhead
  • ObjectTX(CORBAetc.):Traffic!
  • Atomiconlymanageablewithinonecompany/enterprise
  • DBtransactions:Shouldneverbelong
  • Solutions
  • Longtx oninmemoryobjectmodelsonly
  • O/Rmapping
  • Writeonce(≈ACID),failifconcurrentchangesoccurred
  • Optimisticlocking(changecounter,selectforupdate)
  • Timeframe:absolutemaxisseveralhours,butmostlyratherminutesfor
  • neworkitem
  • Sessiongroupslongrunningtx in"userinteraction"
  • Logicalsequenceofatomichighleveltx (workflow)
  • Onlymanageablewithcoarsergrainedhigherlevelcalls(services)
  • Designsystemsothatinconsistenciesarealsoavoidedbythenature
  • ftheworkflow
  • Compensation,etc.