Skip to content

Commit

Permalink
improve readability of txn session close
Browse files Browse the repository at this point in the history
  • Loading branch information
Nephery committed Jun 20, 2024
1 parent 486c5d3 commit 6ccf400
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ public void unbind() {
LOGGER.info("Unbinding flow receiver container {}", id);
flowReceiverReference.getStaleMessagesFlag().set(true);
flowReceiverReference.get().close();
Optional.ofNullable(flowReceiverReference.getTransactedSession()).ifPresent(TransactedSession::close);
TransactedSession transactedSession = flowReceiverReference.getTransactedSession();
if (transactedSession != null) {
transactedSession.close();
}
}
} finally {
writeLock.unlock();
Expand Down

0 comments on commit 6ccf400

Please sign in to comment.