Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distributed Transactions in Java

 
jim jjoh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have to do operations in 3 different schema from my application.
I am using Jboss as my application server.
Can you suggest a best way to handle transactions.
I have some theoretical knowledge about 2 phase commit.

Can anyone provide a solution.

Thanks
 
Martin Vajsar
Sheriff
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all three schemas reside in the same database, you might be able (depending on the database) to grant necessary permissions and access all the schemas from a single connection. This way would seem the best to me, as you could completely avoid distributed transactions.

If this is not possible, you'd probably need to use a transaction manager that would coordinate distributed transactions. The details of two-phase commits would be managed by it. To the best of my understanding, most application servers have such a transaction manager. I have no direct experience, but googling up transaction manager jboss brings up this.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jim jjoh wrote:I have some theoretical knowledge about 2 phase commit.


Do you have any practical experience with usage of 2 phase commit?

In my experience, it rarely works as you wish. Its more a theoretical solution than a real one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic