Originally posted by Paul Bye:
Can the issue of updating multiple databases be as simple as the code I have written below or am I forgetting something?
It is not as simple as you have thought....Just consider a scenario when you issue
con1.commit(); on connection for DB1 and this is successful, but somehow
con2.commit(); fails, and throws an exception.
Your code will reach in exception block, where you can not rollback a committed transaction.
con1.rollback(); will not rollback a committed transaction.
Shailesh