On Sat, 10 May 2014 13:46:46 +0300, "Vlad Khorsun"
<hv...@users.sourceforge.net> wrote:
>     Surprise : after you got list of tx numbers it can be used to query 
> RDB$TRANSACTIONS for additional info. 

But then I could just as well query RDB$TRANSACTIONS directly. I don't
know the Firebird transaction id: I need to identify it by the Xid I
receive from the transaction manager.

>> Of course I can also query RDB$TRANSACTIONS with RDB$TRANSACTION_STATE
=
>> 1,
>> but in the future I may also need to know if a Xid is already committed
>> or
>> rolled back (although the current code doesn't do that).
> 
>     When you call commit\rollback after reconnect, engine updates 
> RDB$TRANSACTION_STATE correspondingly. 

I know that, but it is about obtaining that information. I also need to be
able to provide information to the transaction manager if he requests the
recovery of a Xid that has already been committed (eg because between the
actual commit on Firebird and confirmation to the transaction manager an
exception could occur (or the application might go down). In that case the
transaction manager will at a later time ask Jaybird to recover the
transaction and retry the commit or rollback and the XA standard prefers to
have correct feedback on the transaction state.

>     If repair failed at some another host (i.e. some participants was
>     committed\rolled back and
> some was left in limbo), you will be able to try repair again, starting
> from that host. I hope you 
> put info about all participants into RDB$DESCRIPTION (as fbclient does)
> along with Xid ? 

In the case of Jaybird we are not following the distributed transaction
model of Firebird, we are following the distributed transaction model of
the XA standard and JTA (Java Transaction API). In that situation, Jaybird
is only a Resource Manager (and the firebird database the resource being
managed), while the whole distributed transaction is coordinated by a
Transaction Manager (which is usually a JavaEE application server).

The Xid contains information about the global transaction identity and the
transaction branch id (both assigned by the global transaction manager).
Jaybird does not know about the other participant (not even if all other
participants are also Firebird database managed by Jaybird).

Mark

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to