Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Transaction management in Spring

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Team,

Let me share my recent interview experience which is a scenario driven. "Assume I have 4 database update operations( 2 SQL Server and 2 Oracle DB).Lets say the first DB SQL updates went fine which are hitting to SQL Server and while running the second DB SQL Query(Oracle) I got a system exception.How do I rollback the SQL update happened on my first database. Since I use different JDBC Connections for both. How do I rollback the changes which were happened on the First DB with out any code change and throw an exception saying system error using spring transactional management.

Thanks a lot for sharing your expertise.


Venki-

 
Bartender
Posts: 20921
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the difference between regular transactions and XA transactions.

XA transactions can actually cover not only JDBC requests to different targets, but more general mechanisms as well.

As for XA in Spring, it's supported, but I've never been called on to use it. I have a book on my shelf that's dedicated to nothing but Java transactions, and I'm not even sure it got into Spring.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!