@pi-r/oracle 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client/index.js +4 -1
  2. package/package.json +4 -4
package/client/index.js CHANGED
@@ -39,8 +39,9 @@ class OraclePool extends DbPool {
39
39
  const DRIVER_MODE = process.env.NODE_ORACLEDB_DRIVER_MODE;
40
40
  const POOL_STATE = {};
41
41
  const POOL_UNUSED = ['poolMax', 'poolMin', 'poolIncrement', 'poolTimeout', 'poolPingInterval', 'poolMaxPerShard', 'connectTimeout', 'queueMax', 'queueRequests', 'queueTimeout'];
42
+ const POOL_ACTIVE = new WeakSet();
42
43
  function removePoolProperties(credential) {
43
- if (!credential.uuidKey) {
44
+ if (!credential.uuidKey && POOL_ACTIVE.has(credential)) {
44
45
  let result;
45
46
  for (let i = 0, length = POOL_UNUSED.length; i < length; ++i) {
46
47
  const attr = POOL_UNUSED[i];
@@ -256,6 +257,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
256
257
  if (oraclePool) {
257
258
  clients.push(client = await oraclePool.getConnection());
258
259
  item.transactionState &= ~64 /* DB_TRANSACTION.AUTH */;
260
+ POOL_ACTIVE.add(credential);
259
261
  return client;
260
262
  }
261
263
  const pool = item.usePool && DbPool.findKey(POOL_STATE, item.usePool, getPoolKey(credential), ...connectOnce ? [item, batch[0]] : [item]);
@@ -266,6 +268,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
266
268
  oraclePool = pool;
267
269
  }
268
270
  pool.connected = true;
271
+ POOL_ACTIVE.add(credential);
269
272
  }
270
273
  catch (err) {
271
274
  let close;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/oracle",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Oracle client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/anpham6/pi-r.git",
12
+ "url": "git+https://github.com/anpham6/pi-r.git",
13
13
  "directory": "src/db/oracle"
14
14
  },
15
15
  "keywords": [
@@ -21,8 +21,8 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://github.com/anpham6/pi-r#readme",
23
23
  "dependencies": {
24
- "@e-mc/db": "^0.8.2",
25
- "@e-mc/types": "^0.8.2",
24
+ "@e-mc/db": "^0.8.4",
25
+ "@e-mc/types": "^0.8.4",
26
26
  "oracledb": "^6.3.0"
27
27
  }
28
28
  }