• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Distributed Transactions in Java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic