Subject Re: [ib-support] Transaction spanning 2 databases ...
Author Bill Katelis
Helen Borrie wrote:

>At 11:24 AM 19-09-02 +1000, you wrote:
>
>
>>Platform: SCO/Unix IB 5.5 ESQL
>>Hi,
>>
>>Can a single transaction span multiple databases ?
>>
>>
>
>Yes.
>
>
>
>
>>ie. (pseudo-code)
>>
>>connect db1;
>>start work;
>>
>> Call function to update db2;
>> update db1;
>> if error
>> rollback; (will this rollback changes to db2 ?)
>>
>>commit work;
>>
>>
>
>Fb/IB supports 2-phase commit so you don't handle the rollback logic
>yourself. Your pseudocode model is more like this:
>
>start transaction;
> connect db1;
> connect db2;
> Call function to update db2;
> update db1;
>
>commit work;
> except on failure
>rollback rolls back all;
>
>Helen
>
>
>
>
Thanks for you prompt reply Helen.

Is this possible in IB version 5.5 or just FB/Ib ?

And I notice you start a transaction and then connect to both db's
whereas in our ESQL application we are already connected to the first
db. The second db will be remote.
Are there any esql examples of this anywhere?

thanks
bill