8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:43:04 +01:00

Add ability to get a list of currently active transactions via isc_database_info call

This commit is contained in:
skidder 2003-02-22 21:54:10 +00:00
parent f54ca0bea3
commit 747bad9b5c
2 changed files with 19 additions and 1 deletions

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: ibase.h,v 1.27 2003-02-20 00:10:09 brodsom Exp $
$Id: ibase.h,v 1.28 2003-02-22 21:54:10 skidder Exp $
*/
#ifndef JRD_IBASE_H
@ -1639,6 +1639,7 @@ enum db_info_types
isc_info_oldest_snapshot = 106,
isc_info_next_transaction = 107,
isc_info_db_provider = 108,
isc_info_active_transactions = 109,
isc_info_db_last_value /* Leave this LAST! */
};

View File

@ -566,6 +566,23 @@ int INF_database_info(
}
continue;
case isc_info_active_transactions:
if (!transaction)
transaction = TRA_start(tdbb, 0, NULL);
for (id = transaction->tra_oldest_active;
id < transaction->tra_number; id++)
if (TRA_snapshot_state(tdbb, transaction, id) == tra_active) {
length = INF_convert(id, buffer);
if (!
(info =
INF_put_item(item, length, buffer, info, end))) {
if (transaction)
TRA_commit(tdbb, transaction, FALSE);
return FALSE;
}
}
continue;
case isc_info_user_names:
for (att = dbb->dbb_attachments; att; att = att->att_next) {
if (att->att_flags & ATT_shutdown)