From 0ab34aa7b9c3c48ea6cf17888620fca455284d35 Mon Sep 17 00:00:00 2001 From: Andy Schwerin Date: Sat, 16 Apr 2016 12:24:16 -0400 Subject: SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext(). Also, make OperationContextImpl's constructor private so that it can only be constructed via a Client. --- src/mongo/dbtests/dbhelper_tests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mongo/dbtests/dbhelper_tests.cpp') diff --git a/src/mongo/dbtests/dbhelper_tests.cpp b/src/mongo/dbtests/dbhelper_tests.cpp index 8d7909eac65..aee6a0f406a 100644 --- a/src/mongo/dbtests/dbhelper_tests.cpp +++ b/src/mongo/dbtests/dbhelper_tests.cpp @@ -31,10 +31,10 @@ #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database_holder.h" +#include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/dbhelpers.h" -#include "mongo/db/operation_context_impl.h" #include "mongo/db/range_arithmetic.h" #include "mongo/db/write_concern_options.h" #include "mongo/dbtests/dbtests.h" @@ -58,7 +58,8 @@ public: RemoveRange() : _min(4), _max(8) {} void run() { - OperationContextImpl txn; + const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); + OperationContext& txn = *txnPtr; DBDirectClient client(&txn); for (int i = 0; i < 10; ++i) { -- cgit v1.2.1