Skip to content

Commit

Permalink
fix: only check for transaction state if session exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst authored and daprahamian committed Aug 13, 2019
1 parent 875e04e commit 360975a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/operations/execute_operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function executeWithServerSelection(topology, operation, callback) {

const shouldRetryReads =
topology.s.options.retryReads !== false &&
!operation.session.inTransaction() &&
(operation.session && !operation.session.inTransaction()) &&
maxWireVersion(server) >= 6;

if (operation.hasAspect(Aspect.RETRYABLE) && shouldRetryReads) {
Expand Down

0 comments on commit 360975a

Please sign in to comment.