diff options
author | Eric Milkie <milkie@10gen.com> | 2016-04-19 08:28:56 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2016-04-19 08:28:56 -0400 |
commit | 35ea899074d1bf93e78177cac1155b4471cbaa7d (patch) | |
tree | fce52bf3d3b3fcd270d33ab228babf6ea6602e22 /src/mongo/dbtests/directclienttests.cpp | |
parent | 0ab34aa7b9c3c48ea6cf17888620fca455284d35 (diff) | |
download | mongo-35ea899074d1bf93e78177cac1155b4471cbaa7d.tar.gz |
Revert "SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext()."
This reverts commit 0ab34aa7b9c3c48ea6cf17888620fca455284d35.
Diffstat (limited to 'src/mongo/dbtests/directclienttests.cpp')
-rw-r--r-- | src/mongo/dbtests/directclienttests.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/mongo/dbtests/directclienttests.cpp b/src/mongo/dbtests/directclienttests.cpp index e420ac1f0ab..fd32e9b57d1 100644 --- a/src/mongo/dbtests/directclienttests.cpp +++ b/src/mongo/dbtests/directclienttests.cpp @@ -38,6 +38,7 @@ #include "mongo/db/dbdirectclient.h" #include "mongo/db/json.h" #include "mongo/db/lasterror.h" +#include "mongo/db/operation_context_impl.h" #include "mongo/dbtests/dbtests.h" #include "mongo/util/timer.h" @@ -61,8 +62,7 @@ const char* ns = "a.b"; class Capped : public ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); for (int pass = 0; pass < 3; pass++) { client.createCollection(ns, 1024 * 1024, true, 999); @@ -89,8 +89,7 @@ public: class InsertMany : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); vector<BSONObj> objs; @@ -114,8 +113,7 @@ public: class BadNSCmd : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); BSONObj result; @@ -128,8 +126,7 @@ public: class BadNSQuery : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); unique_ptr<DBClientCursor> cursor = client.query("", Query(), 1); @@ -143,8 +140,7 @@ public: class BadNSGetMore : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); unique_ptr<DBClientCursor> cursor = client.getMore("", 1, 1); @@ -158,8 +154,7 @@ public: class BadNSInsert : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); client.insert("", BSONObj(), 0); @@ -170,8 +165,7 @@ public: class BadNSUpdate : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); client.update("", Query(), BSON("$set" << BSON("x" << 1))); @@ -182,8 +176,7 @@ public: class BadNSRemove : ClientBase { public: virtual void run() { - const ServiceContext::UniqueOperationContext txnPtr = cc().makeOperationContext(); - OperationContext& txn = *txnPtr; + OperationContextImpl txn; DBDirectClient client(&txn); client.remove("", Query()); |