|
1 | 1 | /*
|
2 |
| - Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights |
| 2 | + Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights |
3 | 3 | reserved.
|
4 | 4 |
|
5 | 5 | This program is free software; you can redistribute it and/or
|
|
21 | 21 | "use strict";
|
22 | 22 |
|
23 | 23 | var stats = {
|
24 |
| - "created" : 0, |
| 24 | + "created" : 0, |
25 | 25 | "seizeTransactionContext" : {
|
26 | 26 | "immediate" : 0 , "queued" : 0
|
27 | 27 | },
|
@@ -74,6 +74,7 @@ NdbSession = function(pool) {
|
74 | 74 | this.maxTxContexts = pool.properties.ndb_session_concurrency;
|
75 | 75 | this.openTxContexts = 0; // currently opened
|
76 | 76 | this.isOpenNdbSession = false;
|
| 77 | + this.lockMode = "SHARED"; |
77 | 78 | };
|
78 | 79 |
|
79 | 80 | /* fetch SessionImpl. Undocumented - private to NdbConnectionPool.
|
@@ -183,8 +184,8 @@ NdbSession.prototype.buildReadOperation = function(dbIndexHandler, keys,
|
183 | 184 | dbIndexHandler.tableHandler.dbTable.name,
|
184 | 185 | "using", dbIndexHandler.dbIndex.name);
|
185 | 186 | }
|
186 |
| - var lockMode = "SHARED"; |
187 |
| - var op = ndboperation.newReadOperation(tx, dbIndexHandler, keys, lockMode, isLoad); |
| 187 | + var op = ndboperation.newReadOperation(tx, dbIndexHandler, keys, |
| 188 | + this.lockMode, isLoad); |
188 | 189 | op.userCallback = callback;
|
189 | 190 | return op;
|
190 | 191 | };
|
@@ -362,5 +363,14 @@ NdbSession.prototype.rollback = function (userCallback) {
|
362 | 363 | this.tx.rollback(userCallback);
|
363 | 364 | };
|
364 | 365 |
|
| 366 | +/* setLockMode(lockMode) |
| 367 | + IMMEDIATE |
| 368 | + |
| 369 | + Set Lock Mode for subsequent read operations |
| 370 | +*/ |
| 371 | +NdbSession.prototype.setLockMode = function (lockMode) { |
| 372 | + return ndboperation.setLockMode(this, lockMode); |
| 373 | +}; |
| 374 | + |
365 | 375 |
|
366 | 376 | exports.DBSession = NdbSession;
|
0 commit comments