Search Postgresql Archives

Re: dblink ,dblink_exec not participating in a Transaction??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just to clarify few things in the above posting.
My Main DB Client is java (using hibernate) which has Main Transaction Manager.
This one controls the overall transaction
Work flow is as follows:
1)java program updates a table in Database A
2) As a result Trigger procedure defined for this table gets executed which inturn uses dblink_exec program to update a table in Different database B.
3) Control goes back to java program.
java program will rollback the whole transaction if any errors/exceptions are found.
or else java program will issue a commit.
Java program will determine whether to commit or rollback. It is the main transaction manager.
 
In this case the updates that were made using dblink_exec are not getting rolled back in Database B.
 
 
 


carty mc <cartymc3@xxxxxxxxx> wrote:
How I can make dblink to participate in transaction so that remote changes made by dblink can only be committed if only local transaction succeds.
 
Here is my current scenario:
 
I am using two databases A & B.  In Database A, I have trigger procedure written for  a Table . In this trigger procedure, I use dblink_exec  to update a table in the other database B.
The problem I am having right now is my trigger procedure currently participates in a transaction.  If Transaction rollsback: whatever trigger procedure modified in database A is getting rolled back whereas Chages made to a table in Database B using dblink_exec are not.
Note: Transaction can be rolled back due to excpetions any where from main db client which updates a table in database A .
 
So my question is there a way to  tell dblink_exec to participate in a Transaction. This way commits wont go to table in database B until transaction completed succesfully.
 
 
I appreciate any help,
 
thanks,

You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.


You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux