Abstraction of Transaction Demarcation in Component-Oriented Middleware Romain Rouvoy - Philippe Merle Jacquard INRIA Project LIFL – USTL {Romain.Rouvoy, Second ObjectWeb Consortium conference, Paris, November th, 2002
(JOTM) - D2 - 07/10/2002 Outline è Context è Challenges è Solution è Current experimentations è Conclusion
(JOTM) - D3 - 07/10/2002 Context è Under sun lights of middleware for components Enterprise Java Beans (EJB) CORBA Components (CCM) Next best things as.NET, Web Services, etc. è “Container” is the key technological artifact Transparent integration of extra functionalities Transaction, security, persistency, server scalability, etc. Various approaches Generated interception code, Fractal component membranes, AOP, MOP, … è Many business components require “Transaction Demarcation (TD)” as fundamental extra functionality All/any containers should/will address TD
(JOTM) - D4 - 07/10/2002 EJB Transaction Demarcation EJB Container Java Transaction Service (JTA) 6 TD policies: - SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW Integration already done by JOnAS and any other EJB platforms
(JOTM) - D5 - 07/10/2002 Technical Challenge n°1 EJB Platform 6 TD policies Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM) Not done by JOnAS, is it? Few EJB platforms could do this!
(JOTM) - D6 - 07/10/2002 Technical Challenge n°1 EJB Platform 6 TD policies Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM) Requires abstraction of the TM integration!
(JOTM) - D7 - 07/10/2002 Technical Challenge n°2 Java Open Transaction Manager (JOTM) CCM / OpenCCMEJB / JOnASNext Best Things 6 TD policies Who addresses this factorization?
(JOTM) - D8 - 07/10/2002 Technical Challenge n°2 Java Open Transaction Manager (JOTM) Requires abstraction of the 6 TD policies! CCM / OpenCCMEJB / JOnASNext Best Things
(JOTM) - D9 - 07/10/2002 Technical Challenge n°3 Java Open Transaction Manager (JOTM) Abstraction of the 6 TD policies CCM / OpenCCMEJB / JOnASNext Best Things How adding new TD policies? e.g. requires new sub transaction
(JOTM) - D /10/2002 Technical Challenge n°4 Java Open Transaction Manager (JOTM) Adding new TD policies e.g. requires new sub transaction CCM / OpenCCMEJB / JOnASNext Best Things Requires independence between TD and TM! Object Transaction Service (OTS) Next Best Things (e.g. JOTM)
(JOTM) - D /10/2002 Scientific Challenge è Abstraction of transaction demarcation in component-oriented middleware è Mastering what transaction demarcations are è Mastering what transaction managers are è Defining the Open Transaction Demarcation Framework (OTDF)
(JOTM) - D /10/2002 Framework Challenge CCM / OpenCCMEJB / JOnASNext Best Things Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM) Open Transaction Demarcation Framework (OTDF)
(JOTM) - D /10/2002 Software Challenge è Provides the Java Open Transaction Demarcation Framework (JOTDF) Modular and extensible Aspect- and component-oriented Memory and CPU predictability No performance degradation è JOTDF should include UML diagrams Java interfaces Java classes Fractal components
(JOTM) - D /10/2002 What is OTDF ? EJB Platform OTS JTS JOTM OTDF CCM Platform ?
(JOTM) - D /10/2002 Technical Challenges n°1 : Transaction Manager Abstraction EJB Platform OTS JTS JOTM OTDF Factor Point Define a logical factorization
(JOTM) - D /10/2002 Technical Challenges n°1 : Transaction Manager Abstraction EJB Platform OTS JTS JOTM OTDF Factor Point Need a common protocol
(JOTM) - D /10/2002 Technical Challenges n°1 : Transaction Manager Abstraction EJB Platform OTS JTS JOTM OTDF Factor Point Wrapper Provide a TM abstraction ? ? ? What is this abstraction ?
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Extract the policies CCM Platform 6 TD policies
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction Switch(td) { case Supports : … case Required : … case NotSupported : … case RequiresNew : … case Mandatory : … case Never : … } > TransactionPolicy SupportsRequired NotSupportedRequiresNew MandatoryNever JOnASOTDF Command Design Pattern
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Provide interfaces CCM Platform 6 TD policies
(JOTM) - D /10/2002 Required OTS Not Supported OTS Never OTS Mandatory OTS Supports OTS Requires New OTS Required JTS Not Supported JTS Never JTS Mandatory JTS Supports JTS Requires New JTS 6 TD Policies : - SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Technical code extraction CCM Platform 6 TD Policies : - SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Technical code extraction CCM Platform Required OTS Not Supported OTS Never OTS Mandatory OTS Supports OTS Requires New OTS Required JTS Not Supported JTS Never JTS Mandatory JTS Supports JTS Requires New JTS Not SupportedJTS Requires NewJTS RequiredJTS NeverJTS MandatoryJTS SupportsJTS Not SupportedOTS Requires NewOTS RequiredOTS NeverOTS MandatoryOTS SupportsOTS
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Technical code extraction CCM Platform Not SupportedJTSRequires NewJTSRequiredJTSNeverJTSMandatoryJTSSupportsJTSNot SupportedOTSRequires NewOTSRequiredOTSNeverOTSMandatoryOTSSupportsOTS
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Technical code extraction CCM Platform Not SupportedJTSRequires NewJTSRequiredJTSNeverJTSMandatoryJTSSupportsJTSNot SupportedOTSRequires NewOTSRequiredOTSNeverOTSMandatoryOTSSupportsOTS Requires New Required Mandatory Not Supported Never Supports
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Technical code extraction CCM Platform JTS Not Supported OTS Requires New OTS Required OTS Never OTS Mandatory OTS Supports OTS
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction EJB Platform OTS JTS JOTM OTDF Only demarcation code CCM Platform JTS Not Supported Requires New Required Never Mandatory Supports OTS Same demarcation type ?
(JOTM) - D /10/2002 Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM OTDF CCM Platform JTS Requires New OTS Requires New JOTM Using actual demarcation type
(JOTM) - D /10/2002 Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM OTDF CCM Platform JTS Requires New OTS Requires New JOTM Using actual demarcation type No dependance
(JOTM) - D /10/2002 Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM OTDF Defining new demarcation type CCM Platform JTS Requires New Supports OTS Requires New Sub
(JOTM) - D /10/2002 Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM OTDF Defining new demarcation type CCM Platform JTS Requires New Supports OTS Requires New Sub No dependance
(JOTM) - D /10/2002 OTDF Not Supported Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM Composing existing policies CCM Platform JTS Required Supports Mandatory OTS Coordinator RequiredNot Supported Never
(JOTM) - D /10/2002 OTDF Not Supported Technical Challenges n°3 : Adding new TD policies EJB Platform OTS JTS JOTM Composing existing policies CCM Platform JTS Required Supports Mandatory OTS Coordinator RequiredNot Supported Never
(JOTM) - D /10/2002 OTDF Technical Challenges n°4 : Independence between TD and TM EJB Platform OTS JTS JOTM Only demarcation code CCM Platform JTS Not SupportedRequires NewRequiredNeverMandatorySupports OTS JOTM ?
(JOTM) - D /10/2002 OTDF Technical Challenges n°4 : Independence between TD and TM EJB Platform OTS JTS JOTM Abstraction CCM Platform Not SupportedRequires NewRequiredNeverMandatorySupports TM OTS TM JTS JOTM Independence
(JOTM) - D /10/2002 Technical Challenges n°2 : Transaction Demarcation Abstraction public interface UserTransaction { public int get_status (); public void begin (); public void commit (); public void rollback (); public void set_rollback_only (); public void set_transaction_timeout (int seconds); } public interface TransactionManager extends UserTransaction { public Transaction get_transaction (); public Transaction suspend (); public void resume (Transaction tx); } TM OTS > UserTransaction > TransactionManager
(JOTM) - D /10/2002 OTDF Technical Challenges n°4 : Independence between TD and TM CCM Platform OTS JTS JOTM Instance EJB Platform Not SupportedRequires NewRequiredNeverMandatorySupports TM OTS TM JTS JOTM Not SupportedRequires NewRequiredNeverMandatorySupports
(JOTM) - D /10/2002 OTDF New Technical Challenge : Organisation of the TD OTS JTS JOTM How to structure the policies ? Not SupportedRequires NewRequiredNeverMandatorySupports TM OTS TM JTS JOTM Organization ?
(JOTM) - D /10/2002 Interruption Activation Interrogation New Technical Challenge : Organization of the TD Not SupportedRequiredNeverMandatorySupportsRequires New è No hierarchy/organization in the policies ! è Observing policies to define a structure è Mapping between policies and the structure
(JOTM) - D /10/2002 Domain OTDF New Technical Challenge : Organization of the TD OTS JTS JOTM ? TM OTS TM JTS JOTM Supports Mandatory Never Required Not Supported Requires New Interrogation Activation Interruption Activation
(JOTM) - D /10/2002 New Technical Challenge : Organization of the TD public interface DomainInterrogation extends DomainProtocol { public int get_status(RequestCallContext ctx) ; } public interface DomainActivation extends TransactionStatus { public void begin(RequestCallContext ctx) ; public void commit(RequestCallContext ctx) ; } public interface DomainInterruption extends TransactionStatus { public void suspend(RequestCallContext ctx) ; public void resume(RequestCallContext ctx) ; } > DomainInterrogation > DomainProtocol > DomainActivation > DomainInterruption
(JOTM) - D /10/2002 Domains TM TD Domain OTDF New Technical Challenges : Organization of the TD OTS JTS JOTM TM OTS TM JTS JOTM Interrogation Interruption Activation Supports Mandatory Never Required Not Supported Requires New
(JOTM) - D /10/2002 New Technical Challenges : Organization of the TD public class RequiredPolicyImpl extends AbstractActivationPolicy implements RequiredPolicy { public RequiredPolicyImpl(TransactionActivation ta) { super(ta); } public void preinvoke(RequestCallContext ctx) { if (ta.get_status(ctx)==Status.STATUS_NO_TRANSACTION) ta.begin(ctx); } public void postinvoke(RequestCallContext ctx) { ta.commit(ctx); } > ActivationPolicyImpl ActivationPolicy > RequiredPolicy RequiredPolicyImpl
(JOTM) - D /10/2002 The ODTF Framework OTDF TM OTS TM JTS JOTM Domain Not SupportedRequiredNeverMandatorySupportsNot SupportedRequiredNeverMandatoryRequiredNeverMandatory Requires New Not Supported Interrogation Activation Interruption Domain Interrogation Activation Interruption Domain Interrogation Activation Interruption Multi-plateform Multi-Transaction Manager Extensions Organisation AdaptabilityConfiguration
(JOTM) - D /10/2002 Class Evaluation è Before (without ODTF) Nb Classes = Nb TD x Nb TM E.g. = 6 TD x 3 TM = 18 Classes è After (with ODTF) Nb Classes = Nb TD + Nb Domaines + Nb TM E.g. : 6 TD + 3 Domains + 3 TM = 12 Classes
(JOTM) - D /10/2002 Context of the experimentation è Specifications : Computer : Type :DELL Optiflex GX240 CPU : Intel Pentium GHz RAM : 1024 Mo Bogomips : OS : Linux Debian Kernel : JDK : Version :1.4.1_01 JOnAS : Version :2.5.3 (from CVS) JOTDF : Using Fractal :no Framework Level : 2
(JOTM) - D /10/2002 Context of the experimentation è Experimentation : JOnAS example : sb Invocation :method buy() Type : 1000 invocations inside a transaction 1000 invocations outside a transaction Measure : global execution time number : –10 on JOnAS platform –10 on JOnAS platform with JOTDF
(JOTM) - D /10/2002 The JOnAS’s JODTF Framework JTS Not SupportedRequiredNeverMandatory Requires New JOnAS (EJB) Platform JTS Supports Interrogation Activation Interruption JOTDF
(JOTM) - D /10/2002 Time Evaluation PoliciesJOnASJOnAS & JODTFVariation None --- Supports sec5.871 sec76.43 % Required sec7.598 sec88.84 % Not Supported sec4.814 sec % Requires New sec7.659 sec % Mandatory sec5.357 sec % Never 0.94 sec1.001 sec % Average %
(JOTM) - D /10/2002 Time Evaluation Black Box PoliciesJOnASJOnAS & JODTFVariation None --- Supports sec sec % Required sec sec % Not Supported sec sec % Requires New sec sec % Mandatory sec sec100.2 % Never sec sec100.8 % Average %
(JOTM) - D /10/2002 Theoric Evaluation White Box Policies (Test or Invocation) JOnAS (Pre) + (Post) JOnAS & JODTF (Pre) + (Post) None -- Supports Required Not Supported Requires New Mandatory Never Average
(JOTM) - D /10/2002 Conclusion è We could abstract transaction demarcation in middleware platforms for components with high added values Modular and extensible Aspect- and component-oriented Better memory and CPU predictability No performance degradation è The framework and its code base are available UML diagrams Java interfaces and classes Fractal components è Seamless JOnAS integration done By removing transactional code in JOnAS ;-) By adding adaptation code for our framework ;-( Better integration = Think JOnAS containers as clients of our framework
(JOTM) - D /10/2002 Return to The Future è Apply our approach to some other extra functionalities dealt by containers Distributed logging? Security access control? Others? è Need for a generic and common way for integration/interposition in “containers” Fractal and ASM bytecode generation? Java Aspect Components (JAC)? Meta Object Protocol (MOP)? Interaction service from I3S? Or other adaptation techniques?
(JOTM) - D /10/2002 Questions