28
www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives [email protected]

Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives [email protected]

Embed Size (px)

Citation preview

Page 1: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org

Marek Prochazka

JOTM: Overview and Perspectives

[email protected]

Page 2: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Presentation Outline

JOTM overviewWhat is it (interfaces, services, functionality)Relation to standardsCommunication protocols: RMI/(JRMP, Jeremie), RMI/IIOP(David)Target platforms (JOnAS, …)Research work status

JOTM perspectivesEngineering

•refactoring code base, separating single-JVM and multiple-JVM transaction manager, add-ons, recovery, etc.

Research•CNT/ONT, transactions in component world, adaptable transaction

manager, …)

Page 3: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM Overview

JOTM = Java Open Transaction ManagerJTA-compatible transaction managerFunctional and mature implementation (used in JOnAS)

JOTM functionalityTransaction demarcationRegistration of transaction participantsLocal and distributed transactions

•Multiple transaction coordinators and resource managers

•Transaction context propagationTwo-phase commit protocolACID properties

•Atomicity

•Consistency

Page 4: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Use by clients

Getting the UserTransaction interface via JNDI

interface UserTransaction {void begin( );void commit( );void rollback( );...

}

Explicit transaction demarcation

Involving operations upon objects (EJB) to transactionsImplicit transaction propagation

Page 5: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Use by application servers(middleware layer)

Getting the TransactionManager interface via JNDITransaction TransactionManager.getTransaction( );

interface Transaction {void commit( );void rollback( );boolean enlistResource(XAResource, ...);void registerSynchronization(Synchronization);...

}

Explicit transaction demarcationDeclarative transactions (EJB transaction attributes)Registration of synchronization objects and XA

resources

Page 6: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Java Transaction API (JTA)

Page 7: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Current JOTM Implementation

What is and what is not implemented

ImplementedJTA stuff

•All interfaces

•Local and distributed transactions (JDBC 2.0 standard extension)Timer managementJDBC 1.0 wrapper (JDBC 2.0 pseudo driver)Communication protocols supported

•RMI (Sun’s JRMP, Jeremie)

•RMI/IIOP (David)

Not implementedRecovery

•In case of a crash, ACIDity is not assuredCommunication

•Preprocessing needed

•Full CORBA RMI/IIOP support missing

Page 8: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

What we have planned and accomplished

Grow a shared expertiseMore members: Bull, FranceTelecom, LIFL, Uni. of Valenciennes,

INRIA, Experlog, IMAG, Christophe Ney, Atomicos (potential partner)

Knowledge base at http://www.objectweb.org/jotm/doc/index.html

Leverage the existing code baseBTP proof of the concept implementation (Experlog)Reengineering proposal for the OTS support (LIFL)Advanced transactions prototypes (Valenciennes, Charles Uni.)Recovery support analysis (INRIA)Integration of CAROL (unified code base for support of RMI and

RMI/IIOP)

Page 9: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

What we have planned and accomplished (cont.)

Developing a more generic architecture2 architecture meetingsArchitecture proposals from several partiesShort-time and long-time strategies

Page 10: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Implementation of CNT/ONTby University of Valenciennes

CNT = (Close) Nested Transaction ModelONT = Open Nested Transaction Model

JOTM code modificationNew JOTM branch

Status: CNT almost implemented

Page 11: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Bourgogne Transactionsby Charles University

Support for advanced transaction modelsDependencies, sharing, delegationSupport for user-defined transaction modelsPrototype implemented using JOTM

Extending component interface by transaction context propagation specification

Transaction propagation policy specification using NT&CT attributes

Page 12: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM Workplan

EngineeringShort-time stepsImproving functionality (communication)New functionality (OTS compatibility, recovery)

ResearchWork with long-time perspectiveRebuilding JOTMAdvanced transaction modelsJOTM for Fractal

Page 13: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Refactoring the codeShort-time steps

Simplifying the code

Consolidate the javadoc documentation

Separation of the single-JVM and multiple-JVM transaction manager parts

Sometimes called local/distributed transactionsSingle-JVM transactions do not deal with transaction context propagationMultiple-JVM transactions are dependent on the communication protocol

used

CAROL: Short-time solution for multi-RPC integrationPre-processing not neededCosNaming resource bindingRMI/JRMP context propagation

Page 14: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

No equivalent for some OTS methods in JOTMCoordinator interface

register_subtran_aware(SubtransactionAwareResource)Control create_subtransaction() PropagationContext get_txcontext()

Current interfaceString get_transaction_name()Control get_control()

Differences between JTA and OTSJTA: javax.transaction.Transaction suspend()OTS: Control Current.suspend()

void resume(Control which)

Transaction and Control interfaces are different

OTS supports nested transactionsJTA supports flat transactions only

Support for OTS

Page 15: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Support for Recovery

Recovery: Crucial feature

Enabling JOTM by recoveryLog manager

•Logging all transactional significant events

•Logging two-phase commit states

•Logging all data related to all transaction participants

Recovery manager: Employing the log after a JOTM crash, during recovery

•Reconnection to all participating resources/sub-coordinators

•Reconnection to all JDBC connections (XA resources)

•Committing or rolling back transactions depending on their state

Enabling the JOTM code by logging in appropriate events

Page 16: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Recovery Challenges

ProblemsLack of specification (JTA vs XA resources)Lack of implementation (JDBC 2.0/3.0 drivers)Lack of documentationNo OTS support in JOTM

Divide et imperaLocal recovery

•Single JVM

•XA resources only–Persistent XA resources–Persistent Resource Manager

Distributed recovery•OTS implementation (persistency needed!)

Page 17: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Engineering: Others Tasks

Employing Monolog

FractalizationRefactoring the code before fractalizationRelated to research workplan

Page 18: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Refactoring JOTM:two branches

Engineering – short time stepsJTA implementationBT prototypeCNT/ONT prototypeBTP prototypeOTS implementationActivity Service implementation

Research – long time workIdentification of JOTM building blocks

•Transaction Manager

•Lock Manager

•Log Manager

•Resource Manager

•Dependency Manager

•Communication ManagerDefining their interfacesImplementation / refactoring JOTM

Page 19: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Refactoring JOTM

Requirement of common abstractionsThe notion of Transaction The notion of Resource or Participant

•Recoverable, compensable, ...

Transaction identificationTransaction demarcation

•Significant events, commit protocols, …

The notion of Coordinator or TerminatorDelegationDependencies

Transaction Manager: Engine based on abstractions

Page 20: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Selecting JOTM ModelProposal by University of Valenciennes

JOTM TMPI (Transaction Model Provider Interface)

XA T CNT ONTBusiness

TxBourgogne

Tx …

JOTM Abstract Engine

JOTM TSPI (Transaction Service Provider Interface)

CORBA OTS OASIS BTP …Sun JTS

Page 21: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM and Containersscope of transactions

JOTM TMPI

XA T CNTBusiness

T

JOTM Abstract Engine

JOTM TSPI

Corba OTS OASIS BTPSun JTS

EJB Container

EB EBCCM Container

CC CCWS Container

WS WSAtom A1.1

Cohesion C1

A1.2 A1.3

CurrentTransactions={C1, A1.1, A1.2, A.1.3, …}

BTPclient

Page 22: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM and ContainersContext propagation through several containers

Atom A1.1

Cohesion C1

A1.2 A1.3

JOTM TMPI

XA T CNTBusiness

T

JOTM Abstract Engine

JOTM TSPI

Corba OTS OASIS BTPSun JTS

EJB Container

EB EBCCM Container

CC CCWS Container

WS WS

CurrentTransactions={C1, A1.1, A1.2, A.1.3, …}

ContextPropagation

ContextPropagation

BTPclient

Remark :Context may be

transformed between

containers

Page 23: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Selecting JOTM ModelProposal by LIFL

Page 24: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Selecting JOTM ModelProposal by INRIA

Experiencing the work done by engineering branchImplementations of specifications

•JTA, OTS, BTP, …Advanced transaction models prototypes

•Bourgogne Transactions, CNT/ONT, …Communication

•CAROL, …

Analyzing requirements/limitations

Proposal of key building blocks and their interfaces

Developing the JOTM core

Developing add-ons and personalities

Page 25: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM Building BlocksProposal by INRIA

JTA OTS BTP ONT BT AS

JOTM Core

TransactionManager

LockManager

LogManager

LockManager

ResourceManager

Page 26: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

JOTM Building BlocksExamples

Transaction Managerbegin, commit, abortJTA, OTS: two-phase commit protocolBTP: different commit protocol

Lock ManagerLock, unlock, define_conflict_table, relax_conflictNone of JTA, OTS, BTP, … takes care of locking

Resource ManagerRegister_resource, …

Log ManagerRead_record, write_recordWhat is “log record” (open-nested transactions: storing

compensating actions)

Page 27: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Adaptable Transactional Services

Building blocks basic interfaces

Meta-level interface allowing modify basic interface semantics

Page 28: Www.objectweb.org Marek Prochazka JOTM: Overview and Perspectives Marek.Prochazka@inrialpes.fr

www.objectweb.org (JOTM) - Sept. 2nd 2002

Transactions in Components

Continuing the work on Bourgogne TransactionsTransaction context propagation as a part of the component

interfaceMultiple interfaces: Multiple units of concurrency control

How transactions should be treated in Fractal-like component world?

What is transaction contextHow it should be propagatedWhat policies for propagation of a transaction to a componentHow and where to specify such policies (EJB attributes)Concurrency control policies specification

(EJB: every component is always locked)