Re: SYSCS_DIAG.TRANSACTION_TABLE stale records

2017-07-11 Thread Rick Hillegas

Hi Peter,

How are you disconnecting the sessions? I would expect to see 1 
transaction for every active session, as the following script demonstrates:


-- 1 active session = 1 open transaction
connect 'jdbc:derby:memory:db;create=true' as conn1;
select count(*) from syscs_diag.transaction_table;

-- 2 active sessions = 2 open transactions
connect 'jdbc:derby:memory:db' as conn2;
select count(*) from syscs_diag.transaction_table;

-- 3 active sessions = 3 open transactions
connect 'jdbc:derby:memory:db' as conn3;
select count(*) from syscs_diag.transaction_table;

-- 2 active sessions = 2 open transactions
disconnect;
set connection conn1;
select count(*) from syscs_diag.transaction_table;

-- 1 active session = 1 open transaction
set connection conn2;
disconnect;
set connection conn1;
select count(*) from syscs_diag.transaction_table;

Thanks,
-Rick

On 7/11/17 10:10 AM, Peter Ondruška wrote:

Dear all,

the documentation mentions "The SYSCS_DIAG.TRANSACTION_TABLE 
diagnostic table shows *all of the transactions that are currently *in 
the database." Is it really correct? In my case I have an application 
server (Payara) connected to database with ClientXADataSource. Over 
time the record count in this table grows. When I stop application 
server and all database sessions are disconnected, record count stays 
with no change and I would expect that it drops as transactions are 
definitely closed. The only way to "clean" the diagnostic table is to 
restart database.


All the records are same (different XID of course):

XIDGLOBAL_XIDUSERNAMETYPESTATUS FIRST_INSTANTSQL_TEXT
79512765NULLAPPUserTransactionIDLE NULLNULL

except one SystemTransaction:
XIDGLOBAL_XIDUSERNAMETYPESTATUS FIRST_INSTANTSQL_TEXT
79241843NULLNULLSystemTransactionIDLE NULLNULL

and one UserTransaction (as expected):
XIDGLOBAL_XIDUSERNAMETYPESTATUS FIRST_INSTANTSQL_TEXT
79604720NULLAPPUserTransactionIDLENULL SELECT * 
FROM syscs_diag.transaction_table


Regards,

--
Peter Ondruška

kaibo, s.r.o., ID 28435036, registered with the commercial register 
administered by the Municipal Court in Prague, section C, insert 141269.
Registered office and postal address: kaibo, s.r.o., Kališnická 
379/10, Prague 3, 130 00, Czech Republic.

https://www.kaibo.eu





SYSCS_DIAG.TRANSACTION_TABLE stale records

2017-07-11 Thread Peter Ondruška
Dear all,

the documentation mentions "The SYSCS_DIAG.TRANSACTION_TABLE diagnostic
table shows *all of the transactions that are currently *in the database."
Is it really correct? In my case I have an application server (Payara)
connected to database with ClientXADataSource. Over time the record count
in this table grows. When I stop application server and all database
sessions are disconnected, record count stays with no change and I would
expect that it drops as transactions are definitely closed. The only way to
"clean" the diagnostic table is to restart database.

All the records are same (different XID of course):

XIDGLOBAL_XIDUSERNAMETYPESTATUSFIRST_INSTANTSQL_TEXT
79512765NULLAPPUserTransactionIDLENULLNULL

except one SystemTransaction:
XIDGLOBAL_XIDUSERNAMETYPESTATUSFIRST_INSTANTSQL_TEXT
79241843NULLNULLSystemTransactionIDLENULLNULL

and one UserTransaction (as expected):
XIDGLOBAL_XIDUSERNAMETYPESTATUSFIRST_INSTANTSQL_TEXT
79604720NULLAPPUserTransactionIDLENULLSELECT * FROM
syscs_diag.transaction_table

Regards,

-- 
Peter Ondruška

-- 
kaibo, s.r.o., ID 28435036, registered with the commercial register 
administered by the Municipal Court in Prague, section C, insert 141269.
Registered office and postal address: kaibo, s.r.o., Kališnická 379/10, 
Prague 3, 130 00, Czech Republic.
https://www.kaibo.eu