diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2019-03-13 21:34:34 -0400 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2019-03-15 13:52:00 -0400 |
commit | c346f2db39f1ddae16ecf8643041e19a31a83d84 (patch) | |
tree | ebaaafca11d49aacf77c55448c63bb9d0ba1fd98 /src/mongo/db/db_raii.cpp | |
parent | 4cfb6cd851ef56c8e33bb0587567e9b91153c0de (diff) | |
download | mongo-c346f2db39f1ddae16ecf8643041e19a31a83d84.tar.gz |
SERVER-39942 Extract transaction library from catalog_raii library.
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r-- | src/mongo/db/db_raii.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index cf87b7be354..dd48bc7c36e 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -39,7 +39,6 @@ #include "mongo/db/db_raii_gen.h" #include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/s/collection_sharding_state.h" -#include "mongo/db/transaction_participant.h" #include "mongo/util/log.h" namespace mongo { @@ -331,9 +330,8 @@ OldClientContext::~OldClientContext() { LockMode getLockModeForQuery(OperationContext* opCtx, const boost::optional<NamespaceString>& nss) { invariant(opCtx); - // Use IX locks for autocommit:false multi-statement transactions; otherwise, use IS locks. - auto txnParticipant = TransactionParticipant::get(opCtx); - if (txnParticipant && txnParticipant.inMultiDocumentTransaction()) { + // Use IX locks for multi-statement transactions; otherwise, use IS locks. + if (opCtx->getWriteUnitOfWork()) { uassert(51071, "Cannot query system.views within a transaction", !nss || !nss->isSystemDotViews()); |