SlideShare a Scribd company logo
Transactional OSGi applications done right				    & Karl PaulsClement Escoffier      		, akquinet
OutlineTransactions ???OSGi Transaction Service (RFC-98)Transaction & Dynamism …From “Hell” to the “EJB3-paradise”2Transactional 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.3Transactional OSGi applications done right
Transactions ???Properties(Failure) Atomicity : the action is performed either entirely or not at allConsistency : from a consistent state to another consistent stateIsolation: 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.4Transactional OSGi applications done right
Transactions ??Transaction EnginecommitbeginSequence of actionsrollback5Transactional OSGi applications done rightUsesResources
Why an OSGi Transaction Service ?A lot of OSGi applications deals withDevicesDatabaseRemote resources and services=> Need transactions to ensure the system consistency6Transactional OSGi applications done right
OSGi Transaction ServiceBased on Java Transaction APIXA resourcesTransaction-aware “critical” resourcesJTA common interfaces are provided as OSGi servicesUser Transaction: programmatic transactionsTransaction Synchronization Registry: used by server components such as persistence managers to register synchronization objectTransaction Manager:  allows the server to control transaction boundaries on behalf of the application being managed. 7Transactional OSGi applications done right
OSGi Transaction ServiceServiceReferencetxRef =      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.      } 8Transactional OSGi applications done right
Great … but9Transactional 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 !   10Transactional OSGi applications done right
The “EJB dream”Avoid the developer to manage transactions manuallyTransaction demarcation:methodTransactional method declares the transaction propagationREQUIRED, REQUIRES_NEW, SUPPORTS, NOT_SUPPORTED,   MANDATORY, NEVERThe transaction management is made by the container@TransactionAttribute(REQUIRES_NEW)		public void firstMethod() {...}		@TransactionAttribute(REQUIRED)		public void secondMethod() {...}11Transactional OSGi applications done right
iPOJO Transaction SupportsiPOJO Transaction handlerAutomates transaction managementAllows using transaction just like with EJB@Transactionpublic class MyClass {	@Requires	public FooServicefoo;	@Transactionnal(propagation="requiresnew")	public void firstMethod () {// ...foo.foo(); // Invoke a service//...	}		  @Transactionnal (propagation=“required”)		  public void secondMethod() {...}	          // …   }12Transactional OSGi applications done right
iPOJO Transaction and dynamismHow to automate transaction management ?The transaction management is made by the containerFlexible Allows injecting the current Transaction inside a fieldCan notify the POJO of the current transaction progressWhat 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 invalidHow to support dynamism inside XA resources and volatile resources ?   The Transactional Service Providing handler emulates XA Resources or Volatile resourcesExperimental…13Transactional OSGi applications done right
ConclusionTransactions are becoming more and more important inside OSGi applicationsThe Transaction Service is definitely WelcomeTHANKS !However, we’ve to take care to avoid the Transaction NightmareiPOJO proposes EJB-like transaction management reducing the pain !14Transactional OSGi applications done right
Questions ?Transactional OSGi applications done right15Karl Paulskarl.pauls@akquinet.deBülowstraße 66, 10783 Berlin+49 151 226 49 845Dr.  Clement Escoffierclement.escoffier@akquinet.deBülowstraße 66, 10783 Berlin+49 175 246 77 17

More Related Content

PDF
WebLogic Event Server - Alexandre Alves, BEA
PDF
What's new in the OSGi Enterprise Release 5.0
PDF
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
PDF
Microservices with Spring
PDF
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
KEY
Apache, osgi and karaf par Guillaume Nodet
PDF
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
PDF
Cloud standards interoperability: status update on OCCI and CDMI implementations
WebLogic Event Server - Alexandre Alves, BEA
What's new in the OSGi Enterprise Release 5.0
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
Microservices with Spring
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
Apache, osgi and karaf par Guillaume Nodet
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
Cloud standards interoperability: status update on OCCI and CDMI implementations

What's hot (20)

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

Viewers also liked (20)

PDF
Modular EJBs in OSGi - Tim Ward
PDF
Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...
PDF
Cope Manifesto
PPT
Chapter 10 - Added Values
PPT
Castello Normanno Di Adrano
PDF
Know Your Enemy
PPS
Dm95 slide presentasi_maskot_ponxix_hanum_sujana
PPT
Langkah Membuat Blogspot
PPS
Fantastic Photography
PPTX
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
PPTX
BEACON 101: Sequencing tech
PPTX
Understanding Facebook Places
PDF
Turning event attendees into active active participants
PPTX
2015 pag-chicken
PPTX
Talk at Bioinformatics Open Source Conference, 2012
KEY
Vrouwen In Het Management
PDF
PPTX
Ondernemen in de toekomst
PPT
The Power of Section 1031 for Accounting Professionals
PPTX
Intellisoft introduction @ Recruitment Camp L131229
Modular EJBs in OSGi - Tim Ward
Keynote - Integrating the OSGi Service-Oriented Architecture into the Enterpr...
Cope Manifesto
Chapter 10 - Added Values
Castello Normanno Di Adrano
Know Your Enemy
Dm95 slide presentasi_maskot_ponxix_hanum_sujana
Langkah Membuat Blogspot
Fantastic Photography
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
BEACON 101: Sequencing tech
Understanding Facebook Places
Turning event attendees into active active participants
2015 pag-chicken
Talk at Bioinformatics Open Source Conference, 2012
Vrouwen In Het Management
Ondernemen in de toekomst
The Power of Section 1031 for Accounting Professionals
Intellisoft introduction @ Recruitment Camp L131229
Ad

Similar to Transactional OSGi Applications Done Right (20)

PDF
Autonomous transaction
PPS
Wcf Transaction Handling
PPT
Session 9 Tp9
PDF
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
PPT
Effective Spring Transaction Management
PPTX
Spring Transaction Management
PPTX
Transaction and concurrency pitfalls in Java
PPT
Service oriented component model
PPT
05 Transactions
PPT
Windows Server 2008 for Developers - Part 2
PPT
Windows Workflow Foundation
DOCX
Ui path certificate question set 1
PPTX
Devops presentation
ODP
Ruslan Platonov - Transactions
PPTX
The dude's guide to database consistency
PPTX
MicroServices at Netflix - challenges of scale
PDF
Dbms module iii
PDF
Foomo / Zugspitze Presentation
PDF
Run OSGi on your robot and teach it new tricks - T Verbelen
Autonomous transaction
Wcf Transaction Handling
Session 9 Tp9
Michiel Overeem (AFAS) - Enterprise software schaalbaar maken met Service Fab...
Effective Spring Transaction Management
Spring Transaction Management
Transaction and concurrency pitfalls in Java
Service oriented component model
05 Transactions
Windows Server 2008 for Developers - Part 2
Windows Workflow Foundation
Ui path certificate question set 1
Devops presentation
Ruslan Platonov - Transactions
The dude's guide to database consistency
MicroServices at Netflix - challenges of scale
Dbms module iii
Foomo / Zugspitze Presentation
Run OSGi on your robot and teach it new tricks - T Verbelen

More from Clément Escoffier (15)

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

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine Learning_overview_presentation.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence
Assigned Numbers - 2025 - Bluetooth® Document

Transactional OSGi Applications Done Right

  • 1. Transactional OSGi applications done right & Karl PaulsClement Escoffier , akquinet
  • 2. OutlineTransactions ???OSGi Transaction Service (RFC-98)Transaction & Dynamism …From “Hell” to the “EJB3-paradise”2Transactional 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.3Transactional OSGi applications done right
  • 4. Transactions ???Properties(Failure) Atomicity : the action is performed either entirely or not at allConsistency : from a consistent state to another consistent stateIsolation: 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.4Transactional OSGi applications done right
  • 5. Transactions ??Transaction EnginecommitbeginSequence of actionsrollback5Transactional OSGi applications done rightUsesResources
  • 6. Why an OSGi Transaction Service ?A lot of OSGi applications deals withDevicesDatabaseRemote resources and services=> Need transactions to ensure the system consistency6Transactional OSGi applications done right
  • 7. OSGi Transaction ServiceBased on Java Transaction APIXA resourcesTransaction-aware “critical” resourcesJTA common interfaces are provided as OSGi servicesUser Transaction: programmatic transactionsTransaction Synchronization Registry: used by server components such as persistence managers to register synchronization objectTransaction Manager: allows the server to control transaction boundaries on behalf of the application being managed. 7Transactional OSGi applications done right
  • 8. OSGi Transaction ServiceServiceReferencetxRef = 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. } 8Transactional OSGi applications done right
  • 9. Great … but9Transactional 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 ! 10Transactional OSGi applications done right
  • 11. The “EJB dream”Avoid the developer to manage transactions manuallyTransaction demarcation:methodTransactional method declares the transaction propagationREQUIRED, REQUIRES_NEW, SUPPORTS, NOT_SUPPORTED, MANDATORY, NEVERThe transaction management is made by the container@TransactionAttribute(REQUIRES_NEW) public void firstMethod() {...} @TransactionAttribute(REQUIRED) public void secondMethod() {...}11Transactional OSGi applications done right
  • 12. iPOJO Transaction SupportsiPOJO Transaction handlerAutomates transaction managementAllows using transaction just like with EJB@Transactionpublic class MyClass { @Requires public FooServicefoo; @Transactionnal(propagation="requiresnew") public void firstMethod () {// ...foo.foo(); // Invoke a service//... } @Transactionnal (propagation=“required”) public void secondMethod() {...} // … }12Transactional OSGi applications done right
  • 13. iPOJO Transaction and dynamismHow to automate transaction management ?The transaction management is made by the containerFlexible Allows injecting the current Transaction inside a fieldCan notify the POJO of the current transaction progressWhat 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 invalidHow to support dynamism inside XA resources and volatile resources ? The Transactional Service Providing handler emulates XA Resources or Volatile resourcesExperimental…13Transactional OSGi applications done right
  • 14. ConclusionTransactions are becoming more and more important inside OSGi applicationsThe Transaction Service is definitely WelcomeTHANKS !However, we’ve to take care to avoid the Transaction NightmareiPOJO proposes EJB-like transaction management reducing the pain !14Transactional OSGi applications done right
  • 15. Questions ?Transactional OSGi applications done right15Karl Paulskarl.pauls@akquinet.deBülowstraße 66, 10783 Berlin+49 151 226 49 845Dr. Clement Escoffierclement.escoffier@akquinet.deBülowstraße 66, 10783 Berlin+49 175 246 77 17

Editor's Notes

  • #4: Pretty important for all concurrent system dealing with critical and shared resources (database, devices … )
  • #5: 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
  • #6: Transaction are generally attached to a Thread