Subject Re: [IBO] Transaction with multiple connections
Author Helen Borrie
At 01:06 AM 14/08/2003 +0000, you wrote:
>Hi,
>Could someone explain the intended use of TIB_Transaction properties
>IB_Connection1, IB_Connection2.
>
>Can one therefore have multiple TIB_Connections(possibly to separate
>databases) bound by a single transaction, which can then commit and
>rollback changes which apply to both connections?

Yes. There are properties for three connections (IB_Connection,
IB_Connection1, IB_Connection2). It supports the two-phase commit. You
are not limited to three connections, either. If you need more, simply add
them to the Connections[..] collection of the transaction and refer to them
as Connections[3] and so on. 1 connection == 1 database, though. Don't
attempt to make multiple connections to the same database via a single
transaction. {{{shudder}}}


>Or does it just mean that you can have one transaction that multiple
>connections can use independently from one another? (essentially for
>the purpose that you don't have to set the property at run time etc)

No. If you have an application that makes multiple connections, then a
minimum of one transaction instance needs to be instantiated for each
connection - something IBO performs implicitly for the first connection in
an ib_session. I recommend that you use explicit transactions in all
circumstances where a single app is making multiple connections.

Helen