Unix Technical Forum

Re: 2 Different Database Transactions

This is a discussion on Re: 2 Different Database Transactions within the Informix forums, part of the Database Server Software category; --> That's OK. I got it by doing as follows: begin work; insert into db1@server1:tab1 values ... update db2@server2:tab2 set ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 09:36 PM
Dorn Bhechsonggram
 
Posts: n/a
Default Re: 2 Different Database Transactions


That's OK. I got it by doing as follows:

begin work;
insert into db1@server1:tab1 values ...
update db2@server2:tab2 set ...
commit work;

Cheers,
Dorn.


----- Original Message -----
From: "Dorn Bhechsonggram" <dorn@bakcommunications.com>
To: "informix-list" <informix-list@iiug.org>
Sent: Monday, March 01, 2004 02:04 PM
Subject: 2 Different Database Transactions


> I just wonder whether anyone can give me some recommendations.
>
> If I need to execute the query in 2 different databases as follows:
>
> --1st connection
> begin work;
> insert into table1 value ('x');
>
> --2nd connection
> update table2 set column1 = columns2;
> commit work;
>
> I want both transaction to complete and then commit.
> My question is whether I can issue just 1 BEGIN WORK/COMMIT WORK for both
> connection and it will commit for both queries.
>
> I am not sure if I explain clearly. Please let me know.
>
> Thank you.
> Dorn.
>
>
> sending to informix-list


sending to informix-list
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 09:37 PM
Jonathan Leffler
 
Posts: n/a
Default Re: 2 Different Database Transactions

Dorn Bhechsonggram wrote:

> That's OK. I got it by doing as follows:
>
> begin work;
> insert into db1@server1:tab1 values ...
> update db2@server2:tab2 set ...
> commit work;



Yes that's the best way.

You couldn't do it the other way without somehow starting an XA-style
transaction, and having both connections associated with the same
GTRID (global transaction ID). That can be done in C (ESQL/C). I
don't think it can be done in DB-Access or friends.


> ----- Original Message -----
> From: "Dorn Bhechsonggram" <dorn@bakcommunications.com>
>
>>I just wonder whether anyone can give me some recommendations.
>>
>>If I need to execute the query in 2 different databases as follows:
>>
>>--1st connection
>>begin work;
>>insert into table1 value ('x');
>>
>>--2nd connection
>>update table2 set column1 = columns2;
>>commit work;
>>
>>I want both transaction to complete and then commit.
>>My question is whether I can issue just 1 BEGIN WORK/COMMIT WORK for both
>>connection and it will commit for both queries.




--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:04 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com