On 27-8-2011 14:01, Vlad Khorsun wrote:
>> I am currently going over the XA implementation in Jaybird, and this
>> prompted some questions regarding transactions, connections and
>> two-phase commit in Firebird.
>>
>> First of all: are transactions associated with the connection that
>> created it, or is it possible to 'share' the same transaction handle
>> with different connections? In other words: Can I use a single
>> transaction handle for multiple connections that are enlisted in the
>> same distributed transaction?
>
>      When you start distributed transaction, you pass handles of all
> participated attachments and got single common handle of distributed
> transaction. This handle is valid within every attachments above.

What if I don't know all attachments that will be involved in the same 
distributed transaction when the first attachment is enlisted? It looks 
like it would be impossible to enlist an attachment later on.

>      In FB3 we are going to implement additional API call to join two or
> more pre-existing transactions. It will return new handle of new distributed
> transaction, iirc.

Wouldn't it be better to join a new attachment to an existing 
distributed transaction? As far as I can see in the XA specification[1], 
having a pre-existing transaction join a new distributed transactions 
would be incorrect.

>> Second: if I read the IB6 ApiGuide.pdf correctly, then a single
>> connection can have multiple transactions open in parallel, is that a
>> correct interpretation?
>
>      Yes. And this is unique feature of IB\FB.

Ok, so this would essentially mean that a single attachment could be 
involved in multiple distributed transactions at the same time. Are 
there any gotchas with doing that?

>> Third: Can Firebird handle enlistment of multiple transaction handles in
>> a single two-phase commit, or would this require using a single
>> transaction handle for a single transaction branch?
>
>      Not sure i understand you correctly... Attachment could participate in
> few separate distributed transactions at the same time (if this was your
> question).

This is essentially restating that I would like to know if it is 
possible to have multiple attachment work as a single transaction when 
performing a two-phase commit.

1: http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf
-- 
Mark Rotteveel

------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to