oracledb 3.0.0 → 3.1.2
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.
- package/CHANGELOG.md +135 -8
- package/README.md +6 -4
- package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-linux-x64.node +0 -0
- package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-win32-x64.node +0 -0
- package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-linux-x64.node +0 -0
- package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-win32-x64.node +0 -0
- package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-linux-x64.node +0 -0
- package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-win32-x64.node +0 -0
- package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-linux-x64.node +0 -0
- package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-win32-x64.node +0 -0
- package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
- package/lib/connection.js +18 -4
- package/lib/oracledb.js +44 -92
- package/lib/pool.js +36 -2
- package/lib/sodaCollection.js +1 -1
- package/lib/sodaDatabase.js +1 -1
- package/lib/util.js +82 -5
- package/package/README.md +32 -101
- package/package/install.js +139 -0
- package/package/prunebinaries.js +51 -0
- package/package.json +4 -11
- package/binding.gyp +0 -162
- package/lib/rel.txt +0 -1
- package/odpi/.npmignore +0 -4
- package/odpi/LICENSE.md +0 -218
- package/odpi/README.md +0 -61
- package/odpi/embed/README.md +0 -4
- package/odpi/embed/dpi.c +0 -50
- package/odpi/include/dpi.h +0 -1748
- package/odpi/src/dpiConn.c +0 -2089
- package/odpi/src/dpiContext.c +0 -296
- package/odpi/src/dpiData.c +0 -797
- package/odpi/src/dpiDebug.c +0 -184
- package/odpi/src/dpiDeqOptions.c +0 -370
- package/odpi/src/dpiEnqOptions.c +0 -174
- package/odpi/src/dpiEnv.c +0 -189
- package/odpi/src/dpiError.c +0 -204
- package/odpi/src/dpiErrorMessages.h +0 -86
- package/odpi/src/dpiGen.c +0 -303
- package/odpi/src/dpiGlobal.c +0 -292
- package/odpi/src/dpiHandleList.c +0 -117
- package/odpi/src/dpiHandlePool.c +0 -118
- package/odpi/src/dpiImpl.h +0 -1707
- package/odpi/src/dpiLob.c +0 -506
- package/odpi/src/dpiMsgProps.c +0 -386
- package/odpi/src/dpiObject.c +0 -897
- package/odpi/src/dpiObjectAttr.c +0 -115
- package/odpi/src/dpiObjectType.c +0 -326
- package/odpi/src/dpiOci.c +0 -3527
- package/odpi/src/dpiOracleType.c +0 -492
- package/odpi/src/dpiPool.c +0 -549
- package/odpi/src/dpiRowid.c +0 -136
- package/odpi/src/dpiSodaColl.c +0 -685
- package/odpi/src/dpiSodaCollCursor.c +0 -143
- package/odpi/src/dpiSodaDb.c +0 -432
- package/odpi/src/dpiSodaDoc.c +0 -230
- package/odpi/src/dpiSodaDocCursor.c +0 -143
- package/odpi/src/dpiStmt.c +0 -1797
- package/odpi/src/dpiSubscr.c +0 -674
- package/odpi/src/dpiUtils.c +0 -410
- package/odpi/src/dpiVar.c +0 -1794
- package/package/MAKEPKG.BAT +0 -156
- package/package/Makefile +0 -85
- package/package/createpackage.js +0 -186
- package/package/extractpackage.js +0 -76
- package/package/getversion.js +0 -37
- package/package/oracledbinstall.js +0 -497
- package/package/package.json +0 -54
- package/package/util.js +0 -286
- package/src/njsCommon.cpp +0 -1055
- package/src/njsCommon.h +0 -484
- package/src/njsConnection.cpp +0 -2926
- package/src/njsConnection.h +0 -227
- package/src/njsIntLob.cpp +0 -618
- package/src/njsIntLob.h +0 -179
- package/src/njsMessages.cpp +0 -122
- package/src/njsMessages.h +0 -118
- package/src/njsOracle.cpp +0 -1274
- package/src/njsOracle.h +0 -237
- package/src/njsPool.cpp +0 -482
- package/src/njsPool.h +0 -132
- package/src/njsResultSet.cpp +0 -478
- package/src/njsResultSet.h +0 -120
- package/src/njsSodaCollection.cpp +0 -507
- package/src/njsSodaCollection.h +0 -128
- package/src/njsSodaDatabase.cpp +0 -335
- package/src/njsSodaDatabase.h +0 -108
- package/src/njsSodaDocCursor.cpp +0 -203
- package/src/njsSodaDocCursor.h +0 -94
- package/src/njsSodaDocument.cpp +0 -412
- package/src/njsSodaDocument.h +0 -105
- package/src/njsSodaOperation.cpp +0 -557
- package/src/njsSodaOperation.h +0 -123
- package/src/njsSubscription.cpp +0 -388
- package/src/njsSubscription.h +0 -111
- package/src/njsUtils.cpp +0 -158
- package/src/njsUtils.h +0 -68
package/odpi/src/dpiHandleList.c
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
//-----------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
|
3
|
-
// This program is free software: you can modify it and/or redistribute it
|
|
4
|
-
// under the terms of:
|
|
5
|
-
//
|
|
6
|
-
// (i) the Universal Permissive License v 1.0 or at your option, any
|
|
7
|
-
// later version (http://oss.oracle.com/licenses/upl); and/or
|
|
8
|
-
//
|
|
9
|
-
// (ii) the Apache License v 2.0. (http://www.apache.org/licenses/LICENSE-2.0)
|
|
10
|
-
//-----------------------------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
//-----------------------------------------------------------------------------
|
|
13
|
-
// dpiHandleList.c
|
|
14
|
-
// Implementation of a list of handles which are managed in a thread-safe
|
|
15
|
-
// manner. The references to these handles are assumed to be held by other
|
|
16
|
-
// structures. No references are held by the list of handles defined here.
|
|
17
|
-
//-----------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
#include "dpiImpl.h"
|
|
20
|
-
|
|
21
|
-
//-----------------------------------------------------------------------------
|
|
22
|
-
// dpiHandleList__addHandle() [INTERNAL]
|
|
23
|
-
// Add a handle to the list. The list is expanded in sets of 8 handles as
|
|
24
|
-
// needed. A current position is maintained to reduce the number of scans of
|
|
25
|
-
// the list are required. An empty slot is designated by a NULL pointer.
|
|
26
|
-
//-----------------------------------------------------------------------------
|
|
27
|
-
int dpiHandleList__addHandle(dpiHandleList *list, void *handle,
|
|
28
|
-
uint32_t *slotNum, dpiError *error)
|
|
29
|
-
{
|
|
30
|
-
uint32_t numSlots, i;
|
|
31
|
-
void **tempHandles;
|
|
32
|
-
|
|
33
|
-
dpiMutex__acquire(list->mutex);
|
|
34
|
-
if (list->numUsedSlots == list->numSlots) {
|
|
35
|
-
numSlots = list->numSlots + 8;
|
|
36
|
-
if (dpiUtils__allocateMemory(numSlots, sizeof(void*), 1,
|
|
37
|
-
"allocate slots", (void**) &tempHandles, error) < 0) {
|
|
38
|
-
dpiMutex__release(list->mutex);
|
|
39
|
-
return DPI_FAILURE;
|
|
40
|
-
}
|
|
41
|
-
memcpy(tempHandles, list->handles, list->numSlots * sizeof(void*));
|
|
42
|
-
dpiUtils__freeMemory(list->handles);
|
|
43
|
-
list->handles = tempHandles;
|
|
44
|
-
list->numSlots = numSlots;
|
|
45
|
-
*slotNum = list->numUsedSlots++;
|
|
46
|
-
list->currentPos = list->numUsedSlots + 1;
|
|
47
|
-
} else {
|
|
48
|
-
for (i = 0; i < list->numSlots; i++) {
|
|
49
|
-
if (!list->handles[list->currentPos])
|
|
50
|
-
break;
|
|
51
|
-
list->currentPos++;
|
|
52
|
-
if (list->currentPos == list->numSlots)
|
|
53
|
-
list->currentPos = 0;
|
|
54
|
-
}
|
|
55
|
-
list->numUsedSlots++;
|
|
56
|
-
*slotNum = list->currentPos++;
|
|
57
|
-
if (list->currentPos == list->numSlots)
|
|
58
|
-
list->currentPos = 0;
|
|
59
|
-
}
|
|
60
|
-
list->handles[*slotNum] = handle;
|
|
61
|
-
dpiMutex__release(list->mutex);
|
|
62
|
-
return DPI_SUCCESS;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//-----------------------------------------------------------------------------
|
|
67
|
-
// dpiHandleList__create() [INTERNAL]
|
|
68
|
-
// Create a new (empty) list of handles.
|
|
69
|
-
//-----------------------------------------------------------------------------
|
|
70
|
-
int dpiHandleList__create(dpiHandleList **list, dpiError *error)
|
|
71
|
-
{
|
|
72
|
-
dpiHandleList *tempList;
|
|
73
|
-
|
|
74
|
-
if (dpiUtils__allocateMemory(1, sizeof(dpiHandleList), 0,
|
|
75
|
-
"allocate handle list", (void**) &tempList, error) < 0)
|
|
76
|
-
return DPI_FAILURE;
|
|
77
|
-
tempList->numSlots = 8;
|
|
78
|
-
tempList->numUsedSlots = 0;
|
|
79
|
-
if (dpiUtils__allocateMemory(tempList->numSlots, sizeof(void*), 1,
|
|
80
|
-
"allocate handle list slots", (void**) &tempList->handles,
|
|
81
|
-
error) < 0) {
|
|
82
|
-
dpiUtils__freeMemory(tempList);
|
|
83
|
-
return DPI_FAILURE;
|
|
84
|
-
}
|
|
85
|
-
dpiMutex__initialize(tempList->mutex);
|
|
86
|
-
tempList->currentPos = 0;
|
|
87
|
-
*list = tempList;
|
|
88
|
-
return DPI_SUCCESS;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
//-----------------------------------------------------------------------------
|
|
92
|
-
// dpiHandleList__free() [INTERNAL]
|
|
93
|
-
// Free the memory associated with the handle list.
|
|
94
|
-
//-----------------------------------------------------------------------------
|
|
95
|
-
void dpiHandleList__free(dpiHandleList *list)
|
|
96
|
-
{
|
|
97
|
-
if (list->handles) {
|
|
98
|
-
dpiUtils__freeMemory(list->handles);
|
|
99
|
-
list->handles = NULL;
|
|
100
|
-
}
|
|
101
|
-
dpiMutex__destroy(list->mutex);
|
|
102
|
-
dpiUtils__freeMemory(list);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//-----------------------------------------------------------------------------
|
|
107
|
-
// dpiHandleList__removeHandle() [INTERNAL]
|
|
108
|
-
// Remove the handle at the specified location from the list.
|
|
109
|
-
//-----------------------------------------------------------------------------
|
|
110
|
-
void dpiHandleList__removeHandle(dpiHandleList *list, uint32_t slotNum)
|
|
111
|
-
{
|
|
112
|
-
dpiMutex__acquire(list->mutex);
|
|
113
|
-
list->handles[slotNum] = NULL;
|
|
114
|
-
list->numUsedSlots--;
|
|
115
|
-
dpiMutex__release(list->mutex);
|
|
116
|
-
}
|
|
117
|
-
|
package/odpi/src/dpiHandlePool.c
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
//-----------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
|
3
|
-
// This program is free software: you can modify it and/or redistribute it
|
|
4
|
-
// under the terms of:
|
|
5
|
-
//
|
|
6
|
-
// (i) the Universal Permissive License v 1.0 or at your option, any
|
|
7
|
-
// later version (http://oss.oracle.com/licenses/upl); and/or
|
|
8
|
-
//
|
|
9
|
-
// (ii) the Apache License v 2.0. (http://www.apache.org/licenses/LICENSE-2.0)
|
|
10
|
-
//-----------------------------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
//-----------------------------------------------------------------------------
|
|
13
|
-
// dpiHandlePool.c
|
|
14
|
-
// Implementation of a pool of handles which can be acquired and released in
|
|
15
|
-
// a thread-safe manner. The pool is a circular queue where handles are
|
|
16
|
-
// acquired from the front and released to the back.
|
|
17
|
-
//-----------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
#include "dpiImpl.h"
|
|
20
|
-
|
|
21
|
-
//-----------------------------------------------------------------------------
|
|
22
|
-
// dpiHandlePool__acquire() [INTERNAL]
|
|
23
|
-
// Acquire a handle from the pool. If a handle is available, it will be
|
|
24
|
-
// cleared out of the pool and returned to the caller. It is the caller's
|
|
25
|
-
// responsibility to return the handle back to the pool when it is finished
|
|
26
|
-
// with it. If no handle is available, a NULL value is returned. The caller is
|
|
27
|
-
// expected to create a new handle and return it to the pool when it is
|
|
28
|
-
// finished with it.
|
|
29
|
-
//-----------------------------------------------------------------------------
|
|
30
|
-
int dpiHandlePool__acquire(dpiHandlePool *pool, void **handle, dpiError *error)
|
|
31
|
-
{
|
|
32
|
-
void **tempHandles;
|
|
33
|
-
uint32_t numSlots;
|
|
34
|
-
|
|
35
|
-
dpiMutex__acquire(pool->mutex);
|
|
36
|
-
if (pool->acquirePos != pool->releasePos) {
|
|
37
|
-
*handle = pool->handles[pool->acquirePos];
|
|
38
|
-
pool->handles[pool->acquirePos++] = NULL;
|
|
39
|
-
if (pool->acquirePos == pool->numSlots)
|
|
40
|
-
pool->acquirePos = 0;
|
|
41
|
-
} else {
|
|
42
|
-
*handle = NULL;
|
|
43
|
-
pool->numUsedSlots++;
|
|
44
|
-
if (pool->numUsedSlots > pool->numSlots) {
|
|
45
|
-
numSlots = pool->numSlots + 8;
|
|
46
|
-
if (dpiUtils__allocateMemory(numSlots, sizeof(void*), 1,
|
|
47
|
-
"allocate slots", (void**) &tempHandles, error) < 0) {
|
|
48
|
-
dpiMutex__release(pool->mutex);
|
|
49
|
-
return DPI_FAILURE;
|
|
50
|
-
}
|
|
51
|
-
memcpy(tempHandles, pool->handles, pool->numSlots * sizeof(void*));
|
|
52
|
-
dpiUtils__freeMemory(pool->handles);
|
|
53
|
-
pool->handles = tempHandles;
|
|
54
|
-
pool->numSlots = numSlots;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
dpiMutex__release(pool->mutex);
|
|
58
|
-
|
|
59
|
-
return DPI_SUCCESS;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//-----------------------------------------------------------------------------
|
|
64
|
-
// dpiHandlePool__create() [INTERNAL]
|
|
65
|
-
// Create a new handle pool.
|
|
66
|
-
//-----------------------------------------------------------------------------
|
|
67
|
-
int dpiHandlePool__create(dpiHandlePool **pool, dpiError *error)
|
|
68
|
-
{
|
|
69
|
-
dpiHandlePool *tempPool;
|
|
70
|
-
|
|
71
|
-
if (dpiUtils__allocateMemory(1, sizeof(dpiHandlePool), 0,
|
|
72
|
-
"allocate handle pool", (void**) &tempPool, error) < 0)
|
|
73
|
-
return DPI_FAILURE;
|
|
74
|
-
tempPool->numSlots = 8;
|
|
75
|
-
tempPool->numUsedSlots = 0;
|
|
76
|
-
if (dpiUtils__allocateMemory(tempPool->numSlots, sizeof(void*), 1,
|
|
77
|
-
"allocate handle pool slots", (void**) &tempPool->handles,
|
|
78
|
-
error) < 0) {
|
|
79
|
-
dpiUtils__freeMemory(tempPool);
|
|
80
|
-
return DPI_FAILURE;
|
|
81
|
-
}
|
|
82
|
-
dpiMutex__initialize(tempPool->mutex);
|
|
83
|
-
tempPool->acquirePos = 0;
|
|
84
|
-
tempPool->releasePos = 0;
|
|
85
|
-
*pool = tempPool;
|
|
86
|
-
return DPI_SUCCESS;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
//-----------------------------------------------------------------------------
|
|
90
|
-
// dpiHandlePool__free() [INTERNAL]
|
|
91
|
-
// Free the memory associated with the error pool.
|
|
92
|
-
//-----------------------------------------------------------------------------
|
|
93
|
-
void dpiHandlePool__free(dpiHandlePool *pool)
|
|
94
|
-
{
|
|
95
|
-
if (pool->handles) {
|
|
96
|
-
dpiUtils__freeMemory(pool->handles);
|
|
97
|
-
pool->handles = NULL;
|
|
98
|
-
}
|
|
99
|
-
dpiMutex__destroy(pool->mutex);
|
|
100
|
-
dpiUtils__freeMemory(pool);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//-----------------------------------------------------------------------------
|
|
105
|
-
// dpiHandlePool__release() [INTERNAL]
|
|
106
|
-
// Release a handle back to the pool. No checks are performed on the handle
|
|
107
|
-
// that is being returned to the pool; It will simply be placed back in the
|
|
108
|
-
// pool.
|
|
109
|
-
//-----------------------------------------------------------------------------
|
|
110
|
-
void dpiHandlePool__release(dpiHandlePool *pool, void *handle, dpiError *error)
|
|
111
|
-
{
|
|
112
|
-
dpiMutex__acquire(pool->mutex);
|
|
113
|
-
pool->handles[pool->releasePos++] = handle;
|
|
114
|
-
if (pool->releasePos == pool->numSlots)
|
|
115
|
-
pool->releasePos = 0;
|
|
116
|
-
dpiMutex__release(pool->mutex);
|
|
117
|
-
}
|
|
118
|
-
|