summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index ebed6807c7e..fbf979277e2 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -283,6 +283,7 @@ long long Helpers::removeRange(OperationContext* txn,
BSONObj max;
{
+ ScopedTransaction scopedXact(txn, MODE_IS);
AutoGetCollectionForRead ctx(txn, ns);
Collection* collection = ctx.getCollection();
if (!collection) {
@@ -331,6 +332,7 @@ long long Helpers::removeRange(OperationContext* txn,
while (1) {
// Scoping for write lock.
{
+ ScopedTransaction scopedXact(txn, MODE_IX);
AutoGetCollection ctx(txn, NamespaceString(ns), MODE_IX, MODE_IX);
Collection* collection = ctx.getCollection();
if (!collection)