Øyvind:
You can map your session id to the current transaction in SQL with:
select txid, sid
from sysmaster:sysrstcb as r
join sysmaster:systxptab as t
on t.owner = r.address and r.sid = dbinfo('sessionid');
However, as you have discovered, the transaction id for a given session is reused by that session and appears to be assigned to that session at connect time. Witness, no transaction started:
$ dbaccess art -
Database selected.
> select txid, sid
from sysmaster:sysrstcb as r
join sysmaster:systxptab as t
on t.owner = r.address and r.sid = dbinfo('sessionid');> > >
txid sid
42 90
1 row(s) retrieved.
>
begin work;
Started transaction.
> select txid, sid
from sysmaster:sysrstcb as r
join sysmaster:systxptab as t
on t.owner = r.address and r.sid = dbinfo('sessionid');> > >
txid sid
42 90
1 row(s) retrieved.
>
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------