Subject Re: [Firebird-Java] Re: problem with XAResource.TMJOIN
Author David Jencks
On Oct 28, 2005, at 2:31 PM, Roman Rokytskyy wrote:

>> Looking again at the Jaybird code, I cannot figure out how resources
>> could be joined since there is one xidMap per MC, the only way to fill
>> it with xids is by calling findIscTrHandle() with TMNOFLAGS but in
>> case of resources join findIscTrHandle() should only be called with
>> TMJOIN.
>
> Well... the issue is that we cannot join the same transaction. Firebird
> transaction is bound to the connection, which is in turn bound to the
> managed connection. So, you cannot have managed connection to start
> Firebird
> transaction when TMNOFLAGS are specified and then try to join the same
> transaction in other managed connection using TMJOIN.
>
> The only possibility would be to let managed connection use the same
> physical connection with the other managed connection. But this is not
> supported, and I'm not sure it will be supported in the future.

it used to be, did you remove that code? (not arguing, just asking)
>
>> This seems to explain my "You are trying to resume a transaction that
>> has is new" error message.
>
> Yup.
>
>> Am I right or should I look for bugs somewhere else in my code ?
>
> I would say that we have bug in isSameRM method, it should really
> compare
> the managed connection instances, not the managed connection
> factories. In
> your case it should return "false" and then you would need to start new
> branch. Then it should work ok.

This may be the best solution. However IIRC it has the disadvantage
that the branches will not be able to see each others work. I think
that is why I originally coded the extra layer of indirection. I don't
know of any situations in which an actual app server would need to call
join: does anyone else? If there are no good use cases I think not
having the extra indirection layer and fixing isSameRM as you suggest
is good.

thanks
david jencks

>
> Roman
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>