CORBA Object Transaction Service Telcordia Contact: Paolo Missier - - PDF document

corba object transaction service
SMART_READER_LITE
LIVE PREVIEW

CORBA Object Transaction Service Telcordia Contact: Paolo Missier - - PDF document

CORBA Object Transaction Service Telcordia Contact: Paolo Missier paolo@research.telcordia.com +1 (973) 829 4644 March 29th, 1999 Telcordia Technologies Proprietary Internal Use Only This document contains proprietary information that


slide-1
SLIDE 1

1 CORBA Object Transaction Service

Telcordia Technologies Proprietary – Internal Use Only This document contains proprietary information that shall be distributed, routed or made available only within Telcordia Technologies, except with written permission of Telcordia Technologies.

Telcordia Contact: Paolo Missier paolo@research.telcordia.com +1 (973) 829 4644 March 29th, 1999

An SAIC Company

CORBA OTS – 2 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transactional Support for Distributed Objects

Goals of Distributed Transaction Processing in CORBA:

– Ensure data integrity across multiple heterogeneous sources – Compatibility with existing CORBA services – No extensions to the CORBA core (IDL, ORB) – Interoperability with existing TP Monitors (CICS, Tuxedo, etc.)

slide-2
SLIDE 2

2

CORBA OTS – 3 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Basic ACID Transactional Model: quick review

Atomicity

– Either all or none of the transaction’s operations are performed – If a transaction is interrupted by a failure, its partial results must be undone

Consistency

– Consistent database state: integrity constraints are not violated – Upon conclusion, transactions leave the database in a consistent state – Consistency degrees are defined to specify the acceptable behavior of concurrent transactions

Isolation

– Serializability: the effect of concurrent transaction execution must be the same as that of some serial order – An incomplete transaction cannot reveal its partial results

Durability

CORBA OTS – 4 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

The need for (Distributed) Transactions:

Canonical example: transactional credit-debit application Other uses of DTP: keeping replicas synchronized

– alternative: use replica managers – may use Corba to handle cached data with write-through propagation to the storage

slide-3
SLIDE 3

3

CORBA OTS – 5 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Resource Managers

RMs provide ACID operations on a set of data “any subsystem that implements transactional data can be a RM” [Gray] Examples: DBMS, transactional file systems, transactional queue managers

CORBA OTS – 6 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transactional Applications

Transaction execution spans several app servers and Resource Managers

Transaction Manager Application Application Servers Application Servers Resource Managers Resource Managers

slide-4
SLIDE 4

4

CORBA OTS – 7 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

The Transaction Manager

Monitors the transaction progress Connects clients to servers Coordinates commit and rollback operations Manages failures (system recovery)

CORBA OTS – 8 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

The X/Open DTP Model

Portable Interfaces: XA and TX

– TX defines the 2-Phase Commit Protocol Application Resource Managers Transaction Manager

Requests Begin Commit Abort Join Prepare Commit Abort

TX XA

slide-5
SLIDE 5

5

CORBA OTS – 9 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

The 2-Phase Commit Protocol

Prepare: Invoke each RMs involved in the transaction, asking for a vote Decide:

– if all RMs vote Yes:

write the commit record in the transaction log Commit: send the commit decision to each RM Complete: When all the RMs acknowledge the commit message, write the end-

  • f-transaction record in the log, and deallocate the transaction.

– if at least one RM votes No:

Abort: send the abort decision to each RM Complete: When all the RMs acknowledge the abort message, write the end-of- transaction record in the log, and deallocate the transaction.

CORBA OTS – 10 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

X/Open’s DTP Reference Model for DTP - summary

XA and TX: Protocols for Distributed Transactions Main entities involved in TP:

– The application (AP) – The Resource Manager (RM) – The Transaction Manager (TM)

Procedural interfaces:

– XA between TM and RM – TX between AP and TM

Limitations:

– Interfaces are defined at the programming language level (C, COBOL) – The model does not indicate how invocations are propagated across process/address spaces

slide-6
SLIDE 6

6

CORBA OTS – 11 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transaction Processing Monitors

Built as a Transactional layer on top of the Basic OS (TPOS)

– TRPC

Enforce transactional properties of client/server interactions Provide load balancing, execution monitoring and control Intrusive (performance overhead)

CORBA OTS – 12 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Known Limitations of TP Monitors

Its presence is not transparent to applications and servers Not amenable to distributed object-oriented computing General lack of Java support

– Tuxedo provides a Java-based gateway (JOLT)

Expensive, requires substantial management

slide-7
SLIDE 7

7

CORBA OTS – 13 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

CORBA OTS = DTP + Distributed object computing

CORBA OTS – 14 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Relation with the X/Open Ref. Model

Two main improvements:

– The procedural XA and TX interfaces are replaced with a set of CORBA IDL interfaces

Resource [10.3.7], Current [10.3.1]

– All inter-component communication (i.e., TM, RMs, AP) occur via CORBA calls on instances of implementations for these interfaces

OTS is fully compatible with X/open-compliant software

– tTransactions can be imported from and exported to [10.4.11] XA- compliant RMs and TX-compliant TMs

OTS defines [optional] support for Nested Transactions

slide-8
SLIDE 8

8

CORBA OTS – 15 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS Functional Goals

Co-existence with legacy transactional environments Support for nested transactions (optional) Model Interoperability:

– interoperability with the X/Open DTP model – Object access to existing Resource Managers

Network interoperability:

– multiple TSs and/or multiple ORBs

Support for TP Monitors

– clients, servers, and TSs may run in separate processes – TS must be usable in a TP Monitor Environment

CORBA OTS – 16 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS Design Goals

Low implementation cost:

– Minimal impact on the existing ORB – Reuse of existing Transaction Managers – Low maintenance, simpler than typical TPM

Portability

– Applications (across OTS implementations) – OTS implementations (across ORBs)

No impact on IDL for existing interfaces

– Implementation of the same IDL can be transactional or non-transactional

slide-9
SLIDE 9

9

CORBA OTS – 17 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS Performance Goals

Achieve performance benchmarks similar to X/Open DTP for:

– number of network messages – number of disk accesses – amount of data logged

Note that X/Open is procedural, not OO. Actual benchmarking of Inprise’s ITS in progress in our group

– ITS performance for Oracle-based transactions against native Oracle distributed transaction facility

CORBA OTS – 18 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Approaches to OTS implementation: Inprise’s ITS

Fully integrated with the ORB No need for a separate TS on each node Scalable together with the underlying ORB Entirely Java-based RMs can be Corba servers

slide-10
SLIDE 10

10

CORBA OTS – 19 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Approaches to OTS implementation: IONA’s OTM

The ORBs interfaces with a back-end TP Monitor TS provides interface to specific TPM => users locked into choice of TPM TS cannot be discovered dynamically => TPM required at each node Calls to TPM are not IIOP High maintenance

CORBA OTS – 20 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Approaches to OTS implementation: BEA’s M3

Existing TP Monitor (Tuxedo) + ORB The TP Framework provides:

– Object state management (activation, deactivation) and lifecycle – Transaction management: interface with M3 transaction manager – System events notification to clients

Clear distinction among:

– Development: framework-based – Deployment

OTS, Security, LifeCycle Fault Management, Routing, Load Balancing

– Operations: management tools

Advantage: tight integration with TPM. Useful framework Disadvantage: tight integration with TPM. Rigid framework

slide-11
SLIDE 11

11

CORBA OTS – 21 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS elements: Transaction Context

Goal: to provide trasnaction synchronization across the elements of a distributed c/s application Originator: the client app that requests transaction initiation to the OTS Transaction Context (Scope):

– Created and managed by the OTS when originator requests transaction initiation; – Shared by participants; – Associated to the originator’s thread; – Propagated to objects that participate in the transaction (transactional

  • bjects)

– Propagation can be implicit (done by the OTS), or explicit (as a parameter in CORBA calls)

CORBA OTS – 22 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS Elements: Transactional Objects

An object whose behavior is affected by being invoked within the scope of a transaction Contains (a reference to) persistent data that is manipulated by the transaction Scope of the transaction context:

– a tr.obj. can decide which methods are within the context. Some methods may remain non-transactional

The same interface can have both transactional and nontransactional implementations Transactional objects are used to implement two kind of application servers:

– Transactional Server – Recoverable Server

slide-12
SLIDE 12

12

CORBA OTS – 23 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Recoverable and Resource Objects

Recoverable objects are Transactional objects that participate in the recovery protocol (after a failure) Resources are server objects that implement the Resource interface (X/Open TX interface):

– prepare() – rollback() – commit() – commit_one_phase()

CORBA OTS – 24 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Basic scenario for OTS use

To1 Res1 Originator OTS To2 Res2

Begin() Commit() Register() Op1() Op2() SQL1 SQL2 Register() Prepare() Commit() Prepare() Commit()

x ya za {a | }a yb zb {b }b

slide-13
SLIDE 13

13

CORBA OTS – 25 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Interaction Diagram for Basic Scenario

  • riginator

OTS To1 Res1 To2 Res2 1: begin() 2: op1() 3: register_resource() 4: SQL1 5: return 6: return 7: op2() 8: register_resource() 9: SQL2 10: return 11: return CORBA OTS – 26 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Interaction Diagram for Basic Scenario - 2PC

  • riginator

OTS To1 Res1 To2 Res2 12: commit() 13: prepare() 15: prepare() 14: yes 16: yes 17: commit() 18: commit() 19: ack 20: ack

slide-14
SLIDE 14

14

CORBA OTS – 27 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transaction Creation: Current interface

Used to begin, end and query the status of a transaction Current defines operations for the management of associations between threads and transactions

– one transaction can be associated to more than one thread

Simple to use. Typical idiom:

  • rg.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
  • rg.omg.CORBA.Object initRef =
  • rb.resolve_initial_references("

TransactionCurrent"); current = CurrentHelper.narrow(initRef); current.begin();

CORBA OTS – 28 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transaction Creation: TransactionFactory

Idiom: More restrictive than Current. The Control object may be restricted for use in other environments. Can be used to import transactions that originates outside of the TS

CosTransaction::Control c;

  • rg.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();

TransactionFactory Tfactory = TransactionFactoryHelper .bind(orb); c = TFactory->create(timeout);

slide-15
SLIDE 15

15

CORBA OTS – 29 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Context Management: the Control interface

One Control object is associated with each transaction Control is obtained by:

– Current::get_control() – Current::suspend() – TransactionFactory::create()

It contains a Coordinator and a Terminator Coordinator can be used by a transactional object to:

– register resources: Coordinator::register_resource(in Resource r); – force a transaction to rollback: Coordinator::rollback_only();

Terminator is used by the originator to:

– commit: Terminator::commit(); – rollback: Terminator::rollback();

CORBA OTS – 30 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transaction Propagation

A call on a transactional object may or may not be transactional. In the example scenario:

Op1(), Op2() are transactional calls

How is the transaction context passed to To1, To2? Explicit propagation:

– theControl object is passed as a parameter in the call, e.g.

void To1.Op1(in CosTransaction::Control c, …)

Implicit propagation: transactional objects inherit from a marker interface in the IDL:

To : CosTransaction::TransactionalObject

slide-16
SLIDE 16

16

CORBA OTS – 31 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Resource Registration

Manual registration:

– Res1 implements the CosTransactions::Resource interface – To1 registers Res1 using the Coordinator – Typically, resource registration is the first action in a transactional call – Note: in some implementations, the Coordinator object is not directly available (i.e. in M3). In those cases, this method cannot be used.

Automatic registration:

– Resource has native support from OTS, or it supports the XA/TX interface – Registration is static and occurs before any request to the resource. – OTS can reach the resource’s XA interface

CORBA OTS – 32 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Notes on XA and native support

Inprise provides integrated XA Resource Directors for some XA- compliant resources. However, it is restricted to specific DBMS (e.g. Oracle) and specific versions Orbix only provides filters for registering XA resources Native support depends on specific arrangements among ORB- DBMS/TP Monitor vendors

– Orbix natively supports the Encina TP monitor by Transarc – Inprise supports generic connection to a TP Monitor – M3 is designed around the Tuxedo TP Monitor

slide-17
SLIDE 17

17

CORBA OTS – 33 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Transaction Termination

Only the originator should terminate the transaction. Indirect termination:

– Use

Current::commit(in boolean report_heuristics) Current::rollback()

– heuristics = True: call blocks until all resources are done – heuristics = False: call returns after prepare phase (faster for client)

Direct termination:

– Use

Terminator::commit(in boolean report_heuristics) Terminator ::rollback()

CORBA OTS – 34 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

OTS interfaces summary

slide-18
SLIDE 18

18

CORBA OTS – 35 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Scenario II: Resources as Corba services

To1 Originator OTS To2

Begin() Commit() Register() Op1() Op2() Register() Prepare() Commit() Prepare() Commit()

x ya za { yb zb Res1 Rm1

SQL1

{a Res2 Rm2

SQL2

|a |b

CORBA OTS – 36 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Multithreaded transaction execution

In Scenario I and II, there is a potential for concurrent execution of parts (a) and (b) However, transaction Control is associated with one thread in the

  • riginator

Solution:

– in the originator, split the client into two threads – in each thread, the same Control object ctrl is visible – in each thread, the resume() method is called on ctrl

slide-19
SLIDE 19

19

CORBA OTS – 37 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Multi-tier Application Deployment Scenario

Client App DBMS TPM

O T S

TX TX/XA SQL IIOP IIOP IIOP IIOP

OrderManager Server Data Wrapper Data Wrapper

presentation B.O. middle tier Wrappers Data Layer

CORBA OTS – 38 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Multi-tier Scenario: ORB-centric view

Client App

Data Wrapper Data Wrapper

DBMS TPM

OrderManager Server OTS ORB

slide-20
SLIDE 20

20

CORBA OTS – 39 Telcordia Technologies Proprietary - Internal use only. See proprietary restrictions on title page.

Multi-tier deployement detail

Client App Inventory Manager Account Manager Order Manager (originator) Inventory DB Account DB Inventory Storage Manager Oracle client Account Storage Manager Oracle client

O T S

presentation B.O. middle tier Wrappers Data Layer TX TX SQL SQL IIOP IIOP IIOP IIOP