summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2018-03-27 11:20:13 -0400
committerJames Wahlin <james@mongodb.com>2018-04-16 14:33:12 -0400
commit9652d252a2932fc0096704fccb1152b6b290fe6f (patch)
treeb5a6b0f0f23ef1c1e9c9924c37e8d1d5eedc39e1 /src/mongo/db/db_raii.cpp
parentc02574298a711b6de8a3d89cedcfe98040a6f55b (diff)
downloadmongo-9652d252a2932fc0096704fccb1152b6b290fe6f.tar.gz
SERVER-33690 Transaction abort and commit should kill any associated client cursors
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index 03c3ee52ec5..73032902a49 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -366,8 +366,7 @@ LockMode getLockModeForQuery(OperationContext* opCtx) {
invariant(opCtx);
// Use IX locks for autocommit:false multi-statement transactions; otherwise, use IS locks.
- auto session = OperationContextSession::get(opCtx);
- if (session && session->inMultiDocumentTransaction()) {
+ if (Session::TransactionState::get(opCtx).requiresIXReadUpgrade) {
return MODE_IX;
}
return MODE_IS;