summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/engine_v8-3.25.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-07-24 14:44:23 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-07-28 17:14:17 -0400
commit78d2f38aa445ef1658300e66e1db14b9f1eceba8 (patch)
treed8503e6badb65230017c5c6a4042983283b11933 /src/mongo/scripting/engine_v8-3.25.h
parent5e515de16fe1eac1f7079a2a95aa9e4f716ee3ec (diff)
downloadmongo-78d2f38aa445ef1658300e66e1db14b9f1eceba8.tar.gz
SERVER-13961 Pass through OperationContext in the JS framework
The JS framework uses DBDirectClient, which requires OperationContext in order to not conflict with locks, which have already been acquired. This change also makes dbEval not use pooled scopes and create a new scope instead.
Diffstat (limited to 'src/mongo/scripting/engine_v8-3.25.h')
-rw-r--r--src/mongo/scripting/engine_v8-3.25.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/scripting/engine_v8-3.25.h b/src/mongo/scripting/engine_v8-3.25.h
index 87d1f78ddbf..c75c626019d 100644
--- a/src/mongo/scripting/engine_v8-3.25.h
+++ b/src/mongo/scripting/engine_v8-3.25.h
@@ -172,12 +172,18 @@ namespace mongo {
/** check if there is a pending killOp request */
bool isKillPending() const;
+
+ /**
+ * Obtains the operation context associated with this Scope, so it can be given to the
+ * DBDirectClient used by the V8 engine's connection. Only needed for dbEval.
+ */
+ OperationContext* getOpContext() const;
/**
* Connect to a local database, create a Mongo object instance, and load any
* server-side js into the global object
*/
- virtual void localConnect(const char* dbName);
+ virtual void localConnectForDbEval(OperationContext* txn, const char* dbName);
virtual void externalSetup();
@@ -516,6 +522,7 @@ namespace mongo {
bool _inNativeExecution; // protected by _interruptLock
bool _pendingKill; // protected by _interruptLock
int _opId; // op id for this scope
+ OperationContext* _opCtx; // Op context for DbEval
};
/// Helper to extract V8Scope for an Isolate