1 / 52

Abstraction of Transaction Demarcation in Component-Oriented Middleware

Abstraction of Transaction Demarcation in Component-Oriented Middleware. Romain Rouvoy - Philippe Merle Jacquard INRIA Project LIFL – USTL {Romain.Rouvoy, Philippe.Merle}@lifl.fr Second ObjectWeb Consortium conference, Paris, November 28 - 29th, 2002. Outline. Context Challenges

qiana
Download Presentation

Abstraction of Transaction Demarcation in Component-Oriented Middleware

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Abstraction of Transaction Demarcation in Component-Oriented Middleware Romain Rouvoy - Philippe Merle Jacquard INRIA Project LIFL – USTL {Romain.Rouvoy, Philippe.Merle}@lifl.fr Second ObjectWeb Consortium conference, Paris, November 28 - 29th, 2002

  2. Outline • Context • Challenges • Solution • Current experimentations • Conclusion

  3. 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

  4. EJB Transaction Demarcation EJB Container 6 TD policies: - SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW Integration already done by JOnASand any other EJB platforms Java Transaction Service (JTA)

  5. Technical Challenge n°1 EJB Platform 6 TD policies Not done by JOnAS, is it? Few EJB platforms could do this! Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM)

  6. Technical Challenge n°1 EJB Platform 6 TD policies Requires abstraction of the TM integration! Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM)

  7. Technical Challenge n°2 CCM / OpenCCM EJB / JOnAS Next Best Things 6 TD policies 6 TD policies 6 TD policies Who addresses this factorization? Java Open Transaction Manager (JOTM)

  8. Technical Challenge n°2 CCM / OpenCCM EJB / JOnAS Next Best Things Requires abstraction of the 6 TD policies! Java Open Transaction Manager (JOTM)

  9. Technical Challenge n°3 CCM / OpenCCM EJB / JOnAS Next Best Things Abstraction of the 6 TD policies How adding new TD policies? e.g. requires new sub transaction Java Open Transaction Manager (JOTM)

  10. Technical Challenge n°4 CCM / OpenCCM EJB / JOnAS Next Best Things Adding new TD policies e.g. requires new sub transaction Requires independence between TD and TM! Object Transaction Service (OTS) Java Open Transaction Manager (JOTM) Next Best Things (e.g. JOTM)

  11. 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)

  12. Framework Challenge CCM / OpenCCM EJB / JOnAS Next Best Things Open Transaction Demarcation Framework (OTDF) Object Transaction Service (OTS) Java Transaction Service (JTA) Next Best Things (e.g. JOTM)

  13. 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

  14. What is OTDF ? OTDF OTS EJB Platform ? JTS CCM Platform JOTM

  15. Technical Challenges n°1 :Transaction Manager Abstraction OTDF OTS JTS EJB Platform Factor Point JOTM Define a logical factorization

  16. Technical Challenges n°1 :Transaction Manager Abstraction OTDF OTS JTS EJB Platform Factor Point JOTM Need a common protocol

  17. Wrapper Wrapper Wrapper Technical Challenges n°1 :Transaction Manager Abstraction OTDF ? OTS ? JTS EJB Platform Factor Point ? JOTM Provide a TM abstraction What is this abstraction ?

  18. Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform 6 TD policies JTS CCM Platform 6 TD policies JOTM Extract the policies

  19. Switch(td) { case Supports : … case Required : … case NotSupported : … case RequiresNew : … case Mandatory : … case Never : … } Technical Challenges n°2 :Transaction Demarcation Abstraction JOnAS OTDF <<interface>> TransactionPolicy Supports Required NotSupported RequiresNew Mandatory Never Command Design Pattern

  20. Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform 6 TD policies JTS CCM Platform 6 TD policies JOTM Provide interfaces

  21. Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform Supports JTS 6 TD Policies :- SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW Mandatory JTS Never JTS Required JTS Not Supported JTS JTS Requires New JTS 6 TD Policies :- SUPPORTS - NEVER - MANDATORY - REQUIRED - NOT SUPPORTED - REQUIRES NEW Supports OTS Mandatory OTS CCM Platform Never OTS Required OTS JOTM Not Supported OTS Requires New OTS Technical code extraction

  22. Requires New Not Supported Required Never Mandatory Supports JTS JTS JTS JTS JTS JTS Supports Requires New Required Never Mandatory Not Supported OTS OTS OTS OTS OTS OTS Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform Supports JTS Mandatory JTS Never JTS Required JTS Not Supported JTS JTS Requires New JTS Supports OTS Mandatory OTS CCM Platform Never OTS Required OTS JOTM Not Supported OTS Requires New OTS Technical code extraction

  23. Supports JTS Mandatory JTS Never JTS Required JTS Not Supported JTS Requires New JTS Supports OTS Mandatory OTS Never OTS Required OTS Not Supported OTS Requires New OTS Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform JTS CCM Platform JOTM Technical code extraction

  24. Supports JTS Mandatory JTS Never JTS Required JTS Not Supported JTS Requires New JTS Supports OTS Mandatory OTS Never OTS Required OTS Not Supported OTS Requires New OTS Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform Supports Never JTS Not Supported Mandatory CCM Platform Required JOTM Requires New Technical code extraction

  25. Supports Supports Mandatory Mandatory Never Never Required Required Not Supported Not Supported Requires New Requires New Technical Challenges n°2 :Transaction Demarcation Abstraction OTDF OTS EJB Platform JTS OTS JTS OTS JTS JTS OTS JTS OTS CCM Platform JTS OTS JOTM JTS OTS Technical code extraction

  26. Supports Supports Mandatory Mandatory Never Never Required Required Not Supported Not Supported Requires New Requires New Technical Challenges n°2 :Transaction Demarcation Abstraction Same demarcation type OTDF OTS EJB Platform OTS ? JTS JTS CCM Platform JOTM Only demarcation code

  27. Requires New Requires New Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS JTS Requires New JTS CCM Platform JOTM JOTM Using actual demarcation type

  28. Requires New Requires New Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS JTS Requires New JTS CCM Platform No dependance JOTM JOTM Using actual demarcation type

  29. Supports Supports Requires New Sub Requires New Sub Requires New Requires New Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS JTS JTS CCM Platform JOTM Defining new demarcation type

  30. Supports Supports Requires New Sub Requires New Sub Requires New Requires New Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS JTS No dependance JTS CCM Platform JOTM Defining new demarcation type

  31. Not Supported Not Supported Required Required Coordinator Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS Supports Mandatory Never JTS JTS CCM Platform JOTM Composing existing policies

  32. Not Supported Not Supported Required Required Coordinator Technical Challenges n°3 :Adding new TD policies OTDF OTS EJB Platform OTS Supports Mandatory Never JTS JTS CCM Platform JOTM Composing existing policies

  33. Supports Mandatory Never Required Not Supported Requires New Technical Challenges n°4 :Independence between TD and TM OTDF EJB Platform OTS OTS JTS ? JTS CCM Platform JOTM JOTM Only demarcation code

  34. Supports TM TM TM Mandatory Never Required Not Supported Requires New Technical Challenges n°4 :Independence between TD and TM OTDF EJB Platform OTS OTS JTS Independence JTS JOTM CCM Platform JOTM Abstraction

  35. TM 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); } OTS <<interface>> UserTransaction <<interface>> TransactionManager

  36. Supports Supports TM TM TM Mandatory Mandatory Never Never Required Required Not Supported Not Supported Requires New Requires New Technical Challenges n°4 :Independence between TD and TM OTDF CCM Platform OTS OTS JTS JTS JOTM EJB Platform JOTM Instance

  37. Supports TM TM TM Mandatory Never Required Not Supported Requires New New Technical Challenge :Organisation of the TD OTDF OTS OTS Organization ? JTS JTS JOTM JOTM How to structure the policies ?

  38. Supports Mandatory Never Required Not Supported Requires New New Technical Challenge :Organization of the TD Interrogation Interruption Activation • No hierarchy/organization in the policies ! • Observing policies to define a structure • Mapping between policies and the structure

  39. TM TM TM New Technical Challenge :Organization of the TD OTDF Supports OTS Domain OTS ? Mandatory Interrogation Never Interrogation JTS JTS Activation Required Interruption Not Supported JOTM JOTM Requires New Activation Interruption

  40. New Technical Challenge :Organization of the TD <<interface>> DomainProtocol 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) ; } <<interface>> DomainInterrogation <<interface>> DomainActivation <<interface>> DomainInterruption

  41. TM TM TM New Technical Challenges :Organization of the TD OTDF TD Domains TM Supports OTS OTS Domain Mandatory Interrogation Never JTS JTS Activation Required Interruption Requires New JOTM JOTM Not Supported

  42. New Technical Challenges :Organization of the TD ActivationPolicy 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); } } <<abstract>> ActivationPolicyImpl <<interface>> RequiredPolicy RequiredPolicyImpl

  43. Supports TM TM TM Mandatory Mandatory Mandatory Organisation Requires New Requires New Requires New Never Never Never Adaptability Configuration Required Required Required Not Supported Not Supported Not Supported Extensions The ODTF Framework OTDF Domain Interrogation OTS Activation Interruption Domain Multi-Transaction Manager Multi-plateform Interrogation JTS Activation Interruption Domain Interrogation JOTM Activation Interruption

  44. 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

  45. Context of the experimentation • Specifications : • Computer : • Type : DELL Optiflex GX240 • CPU : Intel Pentium 4 2.00GHz • RAM : 1024 Mo • Bogomips : 3971.48 • OS : Linux Debian • Kernel : 2.4.19-686 • JDK: • Version : 1.4.1_01 • JOnAS : • Version : 2.5.3 (from CVS) • JOTDF : • Using Fractal : no • Framework Level : 2

  46. 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

  47. Supports Mandatory Requires New Never Required Not Supported The JOnAS’s JODTF Framework JOTDF JTS JOnAS (EJB) Platform JTS Interrogation Activation Interruption

  48. Time EvaluationBlack Box

  49. Theoric EvaluationWhite Box

  50. 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

More Related