if (!transaction.addFrameToTransaction(sf.frame())) {
Frame errorFrame = Frames.createErrorFrame("Frame not added to transaction",
Headers.create(Frame.DESTINATION, destination, Frame.TRANSACTION, txId),
"Message delivery failed - the frame cannot be added to the transaction - the number of allowed thread " +
"may have been reached");
<BUG>sf.connection().handler().unregisterTransactionsFromConnection(sf.connection());
</BUG>
sf.connection().write(errorFrame);
sf.connection().close();
return;

if (!transaction.addFrameToTransaction(sf.frame())) {
Frame errorFrame = Frames.createErrorFrame("Frame not added to transaction",
Headers.create(Frame.DESTINATION, destination, Frame.TRANSACTION, txId),
"Message delivery failed - the frame cannot be added to the transaction - the number of allowed thread " +
"may have been reached");
Transactions.INSTANCE.unregisterTransactionsFromConnection(sf.connection());
sf.connection().write(errorFrame);
sf.connection().close();
return;
