SlideShare a Scribd company logo
1 of 15
Transactional OSGi applications done right 				    & Karl Pauls Clement Escoffier      		, akquinet
Outline Transactions ??? OSGi Transaction Service (RFC-98) Transaction & Dynamism … From “Hell” to the “EJB3-paradise” 2 Transactional OSGi applications done right
Transactions ??? Transactions are a mechanism that allows endowing a sequence of actions with the properties of a single atomic (indivisible) action. 3 Transactional OSGi applications done right
Transactions ??? Properties (Failure) Atomicity : the action is performed either entirely or not at all Consistency : from a consistent state to another consistent state Isolation: no intermediate states are visible to any concurrently executing action. Durability: after a transaction has committed, the changes that it made are immune to failures (catastrophes excluded). Transactions are a mechanism that allows endowing a sequence of actions with the properties of a single atomic (indivisible) action. 4 Transactional OSGi applications done right
Transactions ?? Transaction Engine commit begin Sequence of actions rollback 5 Transactional OSGi applications done right Uses Resources
Why an OSGi Transaction Service ? A lot of OSGi applications deals with Devices Database Remote resources and services => Need transactions to ensure the system consistency 6 Transactional OSGi applications done right
OSGi Transaction Service Based on Java Transaction API XA resources Transaction-aware “critical” resources JTA common interfaces are provided as OSGi services User Transaction: programmatic transactions Transaction Synchronization Registry: used by server components such as persistence managers to register synchronization object Transaction Manager:  allows the server to control transaction boundaries on behalf of the application being managed.  7 Transactional OSGi applications done right
OSGi Transaction Service ServiceReferencetxRef =      bundleContext.getServiceReference("javax.transaction.UserTransaction");  UserTransactiontx = (UserTransaction)bundleContext.getService(txRef);           // begin transaction  tx.begin();      // perform some operations in the context of the transaction      try {        // Create a transactional resource  ConfigResourceconfig = ...;        // Perform some transactional work        Configuration x = config.createConfiguration("abc");  tx.commit(); // make changes persistent      } catch (Throwableth) {  tx.rollback(); // rollback changes.       }  8 Transactional OSGi applications done right
Great … but 9 Transactional OSGi applications done right
Dynamism impact … How to automate transaction management ? What happens when a transaction “thread” accesses a service leaving before the end of the transaction ? How to support dynamism with XA resources and volatile resources ? The OSGi Transaction service provides everything to go further !    10 Transactional OSGi applications done right
The “EJB dream” Avoid the developer to manage transactions manually Transaction demarcation:method Transactional method declares the transaction propagation REQUIRED, REQUIRES_NEW, SUPPORTS, NOT_SUPPORTED,   MANDATORY, NEVER The transaction management is made by the container @TransactionAttribute(REQUIRES_NEW) 		public void firstMethod() {...} 		@TransactionAttribute(REQUIRED) 		public void secondMethod() {...} 11 Transactional OSGi applications done right
iPOJO Transaction Supports iPOJO Transaction handler Automates transaction management Allows using transaction just like with EJB @Transaction public class MyClass { 	@Requires 	public FooServicefoo; 	@Transactionnal(propagation="requiresnew") 	public void firstMethod () { // ... foo.foo(); // Invoke a service //... 	} 		  @Transactionnal (propagation=“required”) 		  public void secondMethod() {...} 	          // …    } 12 Transactional OSGi applications done right
iPOJO Transaction and dynamism How to automate transaction management ? The transaction management is made by the container Flexible  Allows injecting the current Transaction inside a field Can notify the POJO of the current transaction progress What happens when a transaction “thread” accesses a service leaving before the end of the transaction ? The transaction is roll backed as soon as an instance becomes invalid How to support dynamism inside XA resources and volatile resources ?    The Transactional Service Providing handler emulates XA Resources or Volatile resources Experimental… 13 Transactional OSGi applications done right
Conclusion Transactions are becoming more and more important inside OSGi applications The Transaction Service is definitely Welcome THANKS ! However, we’ve to take care to avoid the Transaction Nightmare iPOJO proposes EJB-like transaction management reducing the pain ! 14 Transactional OSGi applications done right
Questions ? Transactional OSGi applications done right 15 Karl Paulskarl.pauls@akquinet.de Bülowstraße 66, 10783 Berlin+49 151 226 49 845 Dr.  Clement Escoffierclement.escoffier@akquinet.de Bülowstraße 66, 10783 Berlin+49 175 246 77 17

More Related Content

What's hot

Apache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEEApache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEE
mahrwald
 

What's hot (20)

Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache Karaf
 
Apache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEEApache Aries: A blueprint for developing with OSGi and JEE
Apache Aries: A blueprint for developing with OSGi and JEE
 
How to Serve Blockchain Data with AWS Lambda
How to Serve Blockchain Data with AWS LambdaHow to Serve Blockchain Data with AWS Lambda
How to Serve Blockchain Data with AWS Lambda
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio
 
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 3 of the REAL Webinars on Oracle Cloud Native Application Development (J...
 
Modern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xModern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.x
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
New in Spring Framework 5.0: Functional Web Framework
New in Spring Framework 5.0: Functional Web FrameworkNew in Spring Framework 5.0: Functional Web Framework
New in Spring Framework 5.0: Functional Web Framework
 
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
Scylla Summit 2018: Kong & Cassandra/Scylla for distributed APIs and Microser...
 
Introduction to Istio Service Mesh
Introduction to Istio Service MeshIntroduction to Istio Service Mesh
Introduction to Istio Service Mesh
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Migrating our micro services from Java to Kotlin (Code.Talks 2018)
Migrating our micro services from Java to Kotlin (Code.Talks 2018)Migrating our micro services from Java to Kotlin (Code.Talks 2018)
Migrating our micro services from Java to Kotlin (Code.Talks 2018)
 
Service Discovery in OSGi: Beyond the JVM using Docker and Consul
Service Discovery in OSGi: Beyond the JVM using Docker and ConsulService Discovery in OSGi: Beyond the JVM using Docker and Consul
Service Discovery in OSGi: Beyond the JVM using Docker and Consul
 
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
 
Kuberntes Ingress with Kong
Kuberntes Ingress with KongKuberntes Ingress with Kong
Kuberntes Ingress with Kong
 
REAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKEREAL Expert Alliance OCI series part 4 - OKE
REAL Expert Alliance OCI series part 4 - OKE
 
Scripting Languages in OSGi
Scripting Languages in OSGiScripting Languages in OSGi
Scripting Languages in OSGi
 
Part 2 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 2 of the REAL Webinars on Oracle Cloud Native Application Development (J...Part 2 of the REAL Webinars on Oracle Cloud Native Application Development (J...
Part 2 of the REAL Webinars on Oracle Cloud Native Application Development (J...
 
Agile Development with OSGi
Agile Development with OSGiAgile Development with OSGi
Agile Development with OSGi
 
OSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo RulliOSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo Rulli
 

Viewers also liked

Dm95 slide presentasi_maskot_ponxix_hanum_sujana
Dm95 slide presentasi_maskot_ponxix_hanum_sujanaDm95 slide presentasi_maskot_ponxix_hanum_sujana
Dm95 slide presentasi_maskot_ponxix_hanum_sujana
Hanum Sujana
 
Fantastic Photography
Fantastic  PhotographyFantastic  Photography
Fantastic Photography
lewisj2111
 
BEACON 101: Sequencing tech
BEACON 101: Sequencing techBEACON 101: Sequencing tech
BEACON 101: Sequencing tech
c.titus.brown
 
Understanding Facebook Places
Understanding Facebook PlacesUnderstanding Facebook Places
Understanding Facebook Places
Marco Pacifico
 

Viewers also liked (20)

Modular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim WardModular EJBs in OSGi - Tim Ward
Modular EJBs in OSGi - Tim Ward
 
Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...
Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...
Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...
 
Cope Manifesto
Cope ManifestoCope Manifesto
Cope Manifesto
 
Chapter 10 - Added Values
Chapter 10 - Added ValuesChapter 10 - Added Values
Chapter 10 - Added Values
 
Castello Normanno Di Adrano
Castello Normanno Di AdranoCastello Normanno Di Adrano
Castello Normanno Di Adrano
 
Know Your Enemy
Know Your EnemyKnow Your Enemy
Know Your Enemy
 
Dm95 slide presentasi_maskot_ponxix_hanum_sujana
Dm95 slide presentasi_maskot_ponxix_hanum_sujanaDm95 slide presentasi_maskot_ponxix_hanum_sujana
Dm95 slide presentasi_maskot_ponxix_hanum_sujana
 
Langkah Membuat Blogspot
Langkah Membuat BlogspotLangkah Membuat Blogspot
Langkah Membuat Blogspot
 
Fantastic Photography
Fantastic  PhotographyFantastic  Photography
Fantastic Photography
 
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
 
BEACON 101: Sequencing tech
BEACON 101: Sequencing techBEACON 101: Sequencing tech
BEACON 101: Sequencing tech
 
Understanding Facebook Places
Understanding Facebook PlacesUnderstanding Facebook Places
Understanding Facebook Places
 
Turning event attendees into active active participants
Turning event attendees into active active participantsTurning event attendees into active active participants
Turning event attendees into active active participants
 
2015 pag-chicken
2015 pag-chicken2015 pag-chicken
2015 pag-chicken
 
Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012Talk at Bioinformatics Open Source Conference, 2012
Talk at Bioinformatics Open Source Conference, 2012
 
Vrouwen In Het Management
Vrouwen In Het ManagementVrouwen In Het Management
Vrouwen In Het Management
 
About BMC
About BMCAbout BMC
About BMC
 
Ondernemen in de toekomst
Ondernemen in de toekomstOndernemen in de toekomst
Ondernemen in de toekomst
 
The Power of Section 1031 for Accounting Professionals
The Power of Section 1031 for Accounting ProfessionalsThe Power of Section 1031 for Accounting Professionals
The Power of Section 1031 for Accounting Professionals
 
Intellisoft introduction @ Recruitment Camp L131229
Intellisoft introduction @ Recruitment Camp L131229Intellisoft introduction @ Recruitment Camp L131229
Intellisoft introduction @ Recruitment Camp L131229
 

Similar to Transactional OSGi Applications Done Right

Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9
phanleson
 
Effective Spring Transaction Management
Effective Spring Transaction ManagementEffective Spring Transaction Management
Effective Spring Transaction Management
UMA MAHESWARI
 
Devops presentation
Devops presentationDevops presentation
Devops presentation
k9ert
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - Transactions
Dmitry Buzdin
 

Similar to Transactional OSGi Applications Done Right (20)

Autonomous transaction
Autonomous transactionAutonomous transaction
Autonomous transaction
 
Wcf Transaction Handling
Wcf Transaction HandlingWcf Transaction Handling
Wcf Transaction Handling
 
Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9
 
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
 
Effective Spring Transaction Management
Effective Spring Transaction ManagementEffective Spring Transaction Management
Effective Spring Transaction Management
 
Spring Transaction Management
Spring Transaction ManagementSpring Transaction Management
Spring Transaction Management
 
Ho20
Ho20Ho20
Ho20
 
Transaction and concurrency pitfalls in Java
Transaction and concurrency pitfalls in JavaTransaction and concurrency pitfalls in Java
Transaction and concurrency pitfalls in Java
 
Service oriented component model
Service oriented component modelService oriented component model
Service oriented component model
 
05 Transactions
05 Transactions05 Transactions
05 Transactions
 
Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2
 
Windows Workflow Foundation
Windows Workflow FoundationWindows Workflow Foundation
Windows Workflow Foundation
 
Ui path certificate question set 1
Ui path certificate question set 1Ui path certificate question set 1
Ui path certificate question set 1
 
Devops presentation
Devops presentationDevops presentation
Devops presentation
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - Transactions
 
The dude's guide to database consistency
The dude's guide to database consistencyThe dude's guide to database consistency
The dude's guide to database consistency
 
MicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scaleMicroServices at Netflix - challenges of scale
MicroServices at Netflix - challenges of scale
 
Dbms module iii
Dbms module iiiDbms module iii
Dbms module iii
 
Foomo / Zugspitze Presentation
Foomo / Zugspitze PresentationFoomo / Zugspitze Presentation
Foomo / Zugspitze Presentation
 
Run OSGi on your robot and teach it new tricks - T Verbelen
Run OSGi on your robot and teach it new tricks - T VerbelenRun OSGi on your robot and teach it new tricks - T Verbelen
Run OSGi on your robot and teach it new tricks - T Verbelen
 

More from Clément Escoffier

iPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamismiPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamism
Clément Escoffier
 
Everest - Everything is a resource
Everest - Everything is a resourceEverest - Everything is a resource
Everest - Everything is a resource
Clément Escoffier
 
Linuxtag 2012 - continuous delivery - dream to reality
Linuxtag 2012  - continuous delivery - dream to realityLinuxtag 2012  - continuous delivery - dream to reality
Linuxtag 2012 - continuous delivery - dream to reality
Clément Escoffier
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
Clément Escoffier
 
Experimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middlewareExperimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middleware
Clément Escoffier
 

More from Clément Escoffier (15)

Devoxx France 2023 - 1,2,3 Quarkus.pdf
Devoxx France 2023 - 1,2,3 Quarkus.pdfDevoxx France 2023 - 1,2,3 Quarkus.pdf
Devoxx France 2023 - 1,2,3 Quarkus.pdf
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Java
 
Modularity and Dynamism - The tale of two sisters
Modularity and Dynamism - The tale of two sistersModularity and Dynamism - The tale of two sisters
Modularity and Dynamism - The tale of two sisters
 
h-ubu - An industrial-strength service-oriented component model for JavaScrip...
h-ubu - An industrial-strength service-oriented component model for JavaScrip...h-ubu - An industrial-strength service-oriented component model for JavaScrip...
h-ubu - An industrial-strength service-oriented component model for JavaScrip...
 
OW2 Nanoko
OW2 NanokoOW2 Nanoko
OW2 Nanoko
 
iPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamismiPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamism
 
Everest - Everything is a resource
Everest - Everything is a resourceEverest - Everything is a resource
Everest - Everything is a resource
 
h-ubu - CDI in JavaScript
h-ubu - CDI in JavaScripth-ubu - CDI in JavaScript
h-ubu - CDI in JavaScript
 
h-ubu : CDI in JavaScript
h-ubu : CDI in JavaScripth-ubu : CDI in JavaScript
h-ubu : CDI in JavaScript
 
Linuxtag 2012 - continuous delivery - dream to reality
Linuxtag 2012  - continuous delivery - dream to realityLinuxtag 2012  - continuous delivery - dream to reality
Linuxtag 2012 - continuous delivery - dream to reality
 
OSGi - beyond the myth
OSGi -  beyond the mythOSGi -  beyond the myth
OSGi - beyond the myth
 
One year-with-chameleon
One year-with-chameleonOne year-with-chameleon
One year-with-chameleon
 
The OSGi Framework Multiplication
The OSGi Framework MultiplicationThe OSGi Framework Multiplication
The OSGi Framework Multiplication
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
 
Experimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middlewareExperimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middleware
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Transactional OSGi Applications Done Right

  • 1. Transactional OSGi applications done right & Karl Pauls Clement Escoffier , akquinet
  • 2. Outline Transactions ??? OSGi Transaction Service (RFC-98) Transaction & Dynamism … From “Hell” to the “EJB3-paradise” 2 Transactional OSGi applications done right
  • 3. Transactions ??? Transactions are a mechanism that allows endowing a sequence of actions with the properties of a single atomic (indivisible) action. 3 Transactional OSGi applications done right
  • 4. Transactions ??? Properties (Failure) Atomicity : the action is performed either entirely or not at all Consistency : from a consistent state to another consistent state Isolation: no intermediate states are visible to any concurrently executing action. Durability: after a transaction has committed, the changes that it made are immune to failures (catastrophes excluded). Transactions are a mechanism that allows endowing a sequence of actions with the properties of a single atomic (indivisible) action. 4 Transactional OSGi applications done right
  • 5. Transactions ?? Transaction Engine commit begin Sequence of actions rollback 5 Transactional OSGi applications done right Uses Resources
  • 6. Why an OSGi Transaction Service ? A lot of OSGi applications deals with Devices Database Remote resources and services => Need transactions to ensure the system consistency 6 Transactional OSGi applications done right
  • 7. OSGi Transaction Service Based on Java Transaction API XA resources Transaction-aware “critical” resources JTA common interfaces are provided as OSGi services User Transaction: programmatic transactions Transaction Synchronization Registry: used by server components such as persistence managers to register synchronization object Transaction Manager: allows the server to control transaction boundaries on behalf of the application being managed. 7 Transactional OSGi applications done right
  • 8. OSGi Transaction Service ServiceReferencetxRef = bundleContext.getServiceReference("javax.transaction.UserTransaction"); UserTransactiontx = (UserTransaction)bundleContext.getService(txRef); // begin transaction tx.begin(); // perform some operations in the context of the transaction try { // Create a transactional resource ConfigResourceconfig = ...; // Perform some transactional work Configuration x = config.createConfiguration("abc"); tx.commit(); // make changes persistent } catch (Throwableth) { tx.rollback(); // rollback changes. } 8 Transactional OSGi applications done right
  • 9. Great … but 9 Transactional OSGi applications done right
  • 10. Dynamism impact … How to automate transaction management ? What happens when a transaction “thread” accesses a service leaving before the end of the transaction ? How to support dynamism with XA resources and volatile resources ? The OSGi Transaction service provides everything to go further ! 10 Transactional OSGi applications done right
  • 11. The “EJB dream” Avoid the developer to manage transactions manually Transaction demarcation:method Transactional method declares the transaction propagation REQUIRED, REQUIRES_NEW, SUPPORTS, NOT_SUPPORTED, MANDATORY, NEVER The transaction management is made by the container @TransactionAttribute(REQUIRES_NEW) public void firstMethod() {...} @TransactionAttribute(REQUIRED) public void secondMethod() {...} 11 Transactional OSGi applications done right
  • 12. iPOJO Transaction Supports iPOJO Transaction handler Automates transaction management Allows using transaction just like with EJB @Transaction public class MyClass { @Requires public FooServicefoo; @Transactionnal(propagation="requiresnew") public void firstMethod () { // ... foo.foo(); // Invoke a service //... } @Transactionnal (propagation=“required”) public void secondMethod() {...} // … } 12 Transactional OSGi applications done right
  • 13. iPOJO Transaction and dynamism How to automate transaction management ? The transaction management is made by the container Flexible Allows injecting the current Transaction inside a field Can notify the POJO of the current transaction progress What happens when a transaction “thread” accesses a service leaving before the end of the transaction ? The transaction is roll backed as soon as an instance becomes invalid How to support dynamism inside XA resources and volatile resources ? The Transactional Service Providing handler emulates XA Resources or Volatile resources Experimental… 13 Transactional OSGi applications done right
  • 14. Conclusion Transactions are becoming more and more important inside OSGi applications The Transaction Service is definitely Welcome THANKS ! However, we’ve to take care to avoid the Transaction Nightmare iPOJO proposes EJB-like transaction management reducing the pain ! 14 Transactional OSGi applications done right
  • 15. Questions ? Transactional OSGi applications done right 15 Karl Paulskarl.pauls@akquinet.de Bülowstraße 66, 10783 Berlin+49 151 226 49 845 Dr. Clement Escoffierclement.escoffier@akquinet.de Bülowstraße 66, 10783 Berlin+49 175 246 77 17

Editor's Notes

  1. Pretty important for all concurrent system dealing with critical and shared resources (database, devices … )
  2. Atomicity : all or nothingConsistency : the system goes from a consistent state to another consistent stateIsolation : the transaction execution is not impacted by any other “Threads”Durability: once completed, can no more be altered
  3. Transaction are generally attached to a Thread