• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DBLinks and Two Phase Commit

 
Amber Vaidya
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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 !!
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic