Subject Re: [ib-support] Transaction spanning 2 databases ...
Author Helen Borrie
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