Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Transaction management in Spring

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.


Saloon Keeper
Posts: 22097
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.
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic