• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

DBLinks and Two Phase Commit

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

I have a system that needs to update two databases (both Oracle 10g) in a single transaction.
The question is; if I create a DBLink between the two Oracle databases and treat this transaction as a normal transaction (not XA) would it work?

The system is a standalone java application (not deployed on any web/app server) and I am using Spring for JDBC.

If you think that the above approach will not work, can you please suggest an alternative?

Thanks in advance !!
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes - Oracle - Ejb Transaction Across Database Links

This article is about EJBs but it applies because the transaction is done simply by using the same connection. So you could execute both statements and only call commit if they both succeed.

You could also do an XA transaction via JTA pretty easy in Spring via JBossTS.
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic