Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Usage of XA vs Non-XA Driver for Transactions

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have question. It's clearly known that if we do not deal with multiple types of resources within a single transactions then we do not need XA Driver/ResourceManger (Distributed Txns), we only need non-XA Driver in these scenarios (Local transactions).

My question is, when we develop the application, there are comparatively very few situations deal with multiple types of resources that need distributed transactions (say, db operation and JMS operation in single trasanction), rest all dealing only with single transactional resource, (say, update single database) which do not need XA-Transaction. In this case, which is better way from the below options:

1) Have only XA Driver for both distributed and local transactions.
2) Have XA Diver for distributed transactions and Non-XA Driver for local transaction (Application is going to have 2 Data Sources for
single database)

Is there any performance improvement when we use 2nd option?
What is industry practise?

Thanks in advance,
Chinna
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use XA, the transaction manager is smart enough to decide when to use 2PC...meaning that if you only access a single resource, it won't start 2PC.
reply
    Bookmark Topic Watch Topic
  • New Topic