diff --git a/src/jrd/Monitoring.cpp b/src/jrd/Monitoring.cpp index 44450ca0a9..d5573339a4 100644 --- a/src/jrd/Monitoring.cpp +++ b/src/jrd/Monitoring.cpp @@ -915,14 +915,17 @@ void Monitoring::putAttachment(SnapshotData::DumpRecord& record, const Jrd::Atta record.reset(rel_mon_attachments); int temp = mon_state_idle; - - for (const jrd_tra* transaction_itr = attachment->att_transactions; - transaction_itr; transaction_itr = transaction_itr->tra_next) + for (const jrd_tra* transaction = attachment->att_transactions; + transaction; transaction = transaction->tra_next) { - if (transaction_itr->tra_requests) + for (const jrd_req* request = transaction->tra_requests; + request; request = request->req_tra_next) { - temp = mon_state_active; - break; + if (request->req_transaction && (request->req_flags & req_active)) + { + temp = mon_state_active; + break; + } } } @@ -999,14 +1002,22 @@ void Monitoring::putTransaction(SnapshotData::DumpRecord& record, const jrd_tra* record.reset(rel_mon_transactions); - int temp; + int temp = mon_state_idle; + for (const jrd_req* request = transaction->tra_requests; + request; request = request->req_tra_next) + { + if (request->req_transaction && (request->req_flags & req_active)) + { + temp = mon_state_active; + break; + } + } // transaction id record.storeInteger(f_mon_tra_id, transaction->tra_number); // attachment id record.storeInteger(f_mon_tra_att_id, transaction->tra_attachment->att_attachment_id); // state - temp = transaction->tra_requests ? mon_state_active : mon_state_idle; record.storeInteger(f_mon_tra_state, temp); // timestamp record.storeTimestamp(f_mon_tra_timestamp, transaction->tra_timestamp);