This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
commit d153c3a8ae627d03e08e31e976d18f121ff30646 Author: Andrew Stitcher <[email protected]> AuthorDate: Wed Jun 10 13:32:49 2026 -0400 PROTON-1442: Ensure that transaction id is empty outside transaction This code was written with the assistance of Cursor. --- cpp/src/messaging_adapter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/src/messaging_adapter.cpp b/cpp/src/messaging_adapter.cpp index 0e22b142f..c6dc5b5ea 100644 --- a/cpp/src/messaging_adapter.cpp +++ b/cpp/src/messaging_adapter.cpp @@ -246,6 +246,7 @@ void handle_transaction_coordinator_outcome(messaging_handler& handler, const tr modify_incoming_deliveries(session); } handler.on_session_transaction_aborted(session); + transaction_context->transaction_id = proton::binary{}; return; } else { // Transaction commit is successful @@ -253,6 +254,7 @@ void handle_transaction_coordinator_outcome(messaging_handler& handler, const tr settle_incoming_deliveries(session); handle_outgoing_committed_deliveries(handler, session); handler.on_session_transaction_committed(session); + transaction_context->transaction_id = proton::binary{}; return; } } @@ -270,6 +272,7 @@ void handle_transaction_coordinator_outcome(messaging_handler& handler, const tr transaction_context->error = pn_rejected_disposition_condition(rejected_disp); handler.on_session_transaction_error(session); transaction_context->error = nullptr; + transaction_context->transaction_id = proton::binary{}; return; case transaction_context::State::DISCHARGING: // Note that rollback cannot fail in AMQP as the outcome would be the same, @@ -283,6 +286,7 @@ void handle_transaction_coordinator_outcome(messaging_handler& handler, const tr } handler.on_session_transaction_aborted(session); transaction_context->error = nullptr; + transaction_context->transaction_id = proton::binary{}; return; } case transaction_context::State::NO_TRANSACTION: --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
