• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Spring Boot and JTA support.

 
Bartender
Posts: 1266
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the latest releases, I've noticed that the number of JTA providers officially supported in Spring Boot has been remarkably reduced.
When I started using Spring boot about three years ago, there were three 'starters' providing JTA support: Narayana, Bitronix and Atomikos.
Now Narayana isn't mentioned anymore in the official latest documentation, while Bitronix is marked as deprecated.
This obviously imply that the only choice left is using Atomikos.
I wonder if the next step will be dropping JTA support at all.
I'm about to start a long-term project where I'll need to handle distributed transactions to work with two or more entitymanagers, and I'm doubt if using JTA would be a good choice, or if I'd better start
planning some other strategy to work with more than a single entitymanager - eventual consistency tipical of microservices ?

Any hint ?

 
Ranch Foreman
Posts: 1903
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. JTA is useful when we need to deal with multiple databases.
In one single transaction,  two rows of data may be saved to two different DB's.
But when one save process throws an exception,  both save processes should be rolled back.
JTA is the right approach to handle this situation.

The counterpart of JTA is JPA transaction.
JPA is to deal with a transaction within one DB.
If you use JPA transaction to handle save in two DB's, what will happen?
One set of data is saved. The other set of data is not saved when an exception is thrown.
The transaction is not rolled back.
 
Claude Moore
Bartender
Posts: 1266
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you pretty detailed answer.
What I was asking for was more design-oriented, i.e if JTA is - generally - fading away, at least within Spring and Spring Boot world.
 
Author
Posts: 37
10
Scala IntelliJ IDE Spring Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With most applications moving to the cloud, the focus is on designing them as a set of microservices.
Managing those microservices and the communication/dependecies between is therefore taken care of by the cloud provider.
So yeah, I guess the cloud removes the need for managing distributed transaction from the code and that is why JTA is slowly dying.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic