From e2fc0192ddabbdedfeabd69c838563acee51a1bd Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 26 May 2015 14:40:40 -0700 Subject: [PATCH] Updates for NAN --- CHANGELOG.md | 6 ++++ INSTALL.md | 56 ++++++++++++++++------------------- LICENSE.md | 29 ++++++++++++++++++ README.md | 6 ++-- doc/api.md | 45 ++++++++++++++++------------ examples/webapp.js | 2 +- package.json | 5 ++-- src/njs/src/njsConnection.cpp | 37 +++++++++++++++++++---- src/njs/src/njsConnection.h | 25 ++++++++++++++++ src/njs/src/njsOracle.cpp | 25 ++++++++++++++++ src/njs/src/njsOracle.h | 29 ++++++++++++++++-- src/njs/src/njsPool.cpp | 45 ++++++++++++++++++++++++---- src/njs/src/njsPool.h | 25 ++++++++++++++++ src/njs/src/njsUtils.h | 25 ++++++++++++++++ 14 files changed, 290 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 083229f69..da37489a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## node-oracledb v0.6.0 (26 May 2015) + +- Node-oracledb now builds with Node.js 0.10, Node.js 0.12 and io.js. + +- Fixed naming of `autoCommit` in examples. + ## node-oracledb v0.5.0 (5 May 2015) - Changed the `isAutoCommit` attribute name to `autoCommit`. diff --git a/INSTALL.md b/INSTALL.md index a9a734300..1e4b8e591 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -32,11 +32,10 @@ The Oracle Database Node.js driver node-oracledb powers high performance Node.js The steps below create a Node.js installation for testing. Adjust the steps for your environment. -This node-oracledb release currently works only with Node.js 0.10. It -has been tested with 0.10.35 on 64-bit Oracle Linux and Windows. The -driver can also build in some Mac OS X, 32-bit Linux, 32-bit Windows, -Solaris and AIX environments, but these architectures have not been fully -tested. +This node-oracledb release has been tested with Node 0.10 and 0.12 on +64-bit Oracle Linux and Windows. The driver can also build in some +Mac OS X, 32-bit Linux, 32-bit Windows, Solaris and AIX environments, +but these architectures have not been fully tested. ### Prerequisites @@ -81,20 +80,18 @@ install Oracle Linux yourself, it is free from ### 2.1 Install Node.js Download the -[Node.js 0.10 Linux 64-bit binaries](http://nodejs.org/download/) and +[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and extract the file, for example into `/opt`: ``` cd /opt -tar -zxf node-v0.10.38-linux-x64.tar.gz +tar -zxf node-v0.12.4-linux-x64.tar.gz ``` -This node-oracledb release currently works only with Node.js 0.10. - Set PATH to include Node.js: ``` -export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH +export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH ``` ### 2.2 Install the free Oracle Instant Client RPMs @@ -120,13 +117,19 @@ Install node-oracledb from the npm install oracledb ``` -Node-oracledb will automatically configured to use the highest version +Node-oracledb will automatically be configured to use the highest version Instant Client RPMs installed. To use a different version, follow the instructions to [install on Linux with Instant Client ZIP files](#instzip) instead, setting `OCI_LIB_DIR` and `OCI_INC_DIR` to the appropriate directories. +If you have other Oracle software installed on the same machine, and +the runtime linker is configured to find this other software via +`LD_LIBRARY_PATH` or `ldconfig`, then update the environment to use +the Instant Client RPM libraries, for example +`/usr/lib/oracle/12.1/client64/lib`. + ### 2.4 Run an example program Download the @@ -154,20 +157,18 @@ node select1.js ### 3.1 Install Node.js Download the -[Node.js 0.10 Linux 64-bit binaries](http://nodejs.org/download/) and +[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and extract the file, for example into `/opt`: ``` cd /opt -tar -zxf node-v0.10.38-linux-x64.tar.gz +tar -zxf node-v0.12.4-linux-x64.tar.gz ``` -This node-oracledb release currently works only with Node.js 0.10. - Set PATH to include Node.js: ``` -export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH +export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH ``` ### 3.2 Install the free Oracle Instant Client ZIPs @@ -265,20 +266,18 @@ Oracle Database. ### 4.1 Install Node.js Download the -[Node.js Linux 0.10 64-bit binaries](http://nodejs.org/download/) and +[Node.js Linux 64-bit binaries](http://nodejs.org/download/) and extract the file, for example into `/opt`: ``` cd /opt -tar -zxf node-v0.10.38-linux-x64.tar.gz +tar -zxf node-v0.12.4-linux-x64.tar.gz ``` -This node-oracledb release currently works only with Node.js 0.10. - Set your PATH variable to include Node.js: ``` -export PATH=/opt/node-v0.10.38-linux-x64/bin:$PATH +export PATH=/opt/node-v0.12.4-linux-x64/bin:$PATH ``` ### 4.2 Install the driver @@ -342,14 +341,12 @@ Building node-oracledb requires Xcode from the Mac App store. ### 5.2 Install Node.js -Node.js 0.10 can be installed from various sources, such as via *brew*. +Node.js can be installed from various sources, such as via *brew*. ``` -brew install node010 +brew install node ``` -This node-oracledb release currently works only with Node.js 0.10. - Set your PATH to include the *node* and *npm* binaries: ``` @@ -449,12 +446,10 @@ use a 32-bit stack during build and run time. ### 6.2 Install Node.js -Install the 64-bit Node.js 0.10 MSI (e.g. node-v0.10.38-x64.msi) from +Install the 64-bit Node.js MSI (e.g. node-v0.12.4-x64.msi) from [nodejs.org](http://nodejs.org/download/). Make sure the option to add the Node and npm directories to the path is selected. -This node-oracledb release currently works only with Node.js 0.10. - ### 6.3 Install the free Oracle Instant Client ZIPs Skip this step if you already have Oracle Database or the full Oracle client on your machine. @@ -476,9 +471,8 @@ version first in the path. ### 6.4 Install the driver Start Visual Studio and open a Developer Command Prompt within it. - -If you instead decide to use command shell outside Visual Studio, then -run `vcvars64.bat` or `vcvars.bat` (for 32-bit builds). +(If you instead decide to use a command shell outside Visual Studio, then +run `vcvars64.bat` for 64-bit builds or `vcvars.bat` for 32-bit builds). Use `set PATH` in the shell to confirm the Python, Node.js and Oracle directories are correctly set. If they are not, then set PATH diff --git a/LICENSE.md b/LICENSE.md index 287f7858f..974025029 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,5 @@ +# node-oracledb + You may not use the identified files except in compliance with the Apache License, Version 2.0 (the "License.") @@ -217,3 +219,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` + +# NAN + +``` +Copyright (c) 2015 NAN contributors + +NAN contributors listed at https://github.com/rvagg/nan#contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  +``` diff --git a/README.md b/README.md index 5de3b801d..085526d98 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# node-oracledb version 0.5 +# node-oracledb version 0.6 ## 1. About node-oracledb The Oracle Database Node.js driver powers high performance Node.js applications. -Node-oracledb 0.5 supports basic and advanced Oracle features, including: +Node-oracledb 0.6 supports basic and advanced Oracle features, including: - SQL and PL/SQL Execution - Query results as JavaScript objects or array @@ -23,7 +23,7 @@ Node-oracledb 0.5 supports basic and advanced Oracle features, including: - [Runtime Load Balancing](http://docs.oracle.com/database/121/ADFNS/adfns_perf_scale.htm#ADFNS515) (RLB) - [Transparent Application Failover](http://docs.oracle.com/database/121/ADFNS/adfns_avail.htm#ADFNS534) (TAF) -Node-oracledb 0.5 is a preview release. We are actively working on +Node-oracledb 0.6 is a preview release. We are actively working on adding features including LOB support and batch fetching / streaming of large query result sets. diff --git a/doc/api.md b/doc/api.md index be1e07cb9..3565cc9a5 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1421,35 +1421,42 @@ This paper also gives more detail on configuring DRCP. ### 6.3 External Authentication -Instead of specifying a user and password at connection, Oracle -Database allows applications to use an external password store (such -as +External Authentication allows applications to use an external +password store (such as [Oracle Wallet](http://docs.oracle.com/database/121/DBIMI/to_dbimi10236_d209.htm#DBIMI10236)), -the [Secure Socket Layer](http://docs.oracle.com/database/121/DBSEG/asossl.htm#DBSEG070) +the +[Secure Socket Layer](http://docs.oracle.com/database/121/DBSEG/asossl.htm#DBSEG070) (SSL), or the [operating system](http://docs.oracle.com/database/121/DBSEG/authentication.htm#DBSEG30035) -to validate user access. This mode of authentication is called -*external authentication*. One of the benefits is that database +to validate user access. One of the benefits is that database credentials do not need to be hard coded in the application. To use external authentication, set the *Oracledb* -[`externalAuth`](propdbextauth) property to *true*. Once this is -set, any subsequent connections obtained using the *Oracledb* -[`getConnection()`](#getconnectiondb) or *Pool* +[`externalAuth`](propdbextauth) property to *true*. This property can +also be set in the `connAttrs` or `poolAttrs` parameters of the +*Oracledb* [`getConnection()`](#getconnectiondb) or +[`createPool()`](#createpool) calls, respectively. The `user` and +`password` properties should not be set, or should be empty strings: + +```javascript +oracledb.getConnection( + { + externalAuth: true, + connectString: "localhost/orcl" + }, + . . . +``` + +When `externalAuth` is set, any subsequent connections obtained using +the *Oracledb* [`getConnection()`](#getconnectiondb) or *Pool* [`getConnection()`](#getconnectionpool) calls will use external authentication. Setting this property does not affect the operation of existing connections or pools. -When `externalAuth` is *true*, the `user` and `password` properties -should not be set, or should be empty strings. - -The `externalAuth` property can be overridden in the `connAttrs` or -`poolAttrs` parameters of the *Oracledb* -[`getConnection()`](#getconnectiondb) or [`createPool()`](#createpool) -calls, respectively. Overriding `externalAuth` is not possible for -a *Pool* `getConnection()` call. The connections from a *Pool* object -are always obtained in the manner in which the pool was initially -created. +Using `externalAuth` in the `connAttrs` parameter of a *Pool* +`getConnection()` call is not possible. The connections from a *Pool* +object are always obtained in the manner in which the pool was +initially created. For pools created with external authentication, the number of connections initially created is zero even if a non-zero value is diff --git a/examples/webapp.js b/examples/webapp.js index ea18cf6ae..3953fe691 100644 --- a/examples/webapp.js +++ b/examples/webapp.js @@ -135,7 +135,7 @@ oracledb.createPool ( function handleError(response, text, err) { if (err) { - text += err.message; + text += err.message } console.error(text); response.write("

Error: " + text + "

"); diff --git a/package.json b/package.json index 5f16b6e16..de82efd07 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "oracledb", - "version": "0.5.0", + "version": "0.6.0", "description": "Oracle Database driver by Oracle Corp.", - "license": "Apache 2.0", + "license": "Apache-2.0", "homepage": "http://www.oracle.com/technetwork/database/database-technologies/node_js/index.html", "keywords": [ "oracledb", @@ -37,7 +37,6 @@ "engines": { "node": ">=0.10.28" }, - "engineStrict": true, "maintainers": [ { "name": "Oracle Corp." diff --git a/src/njs/src/njsConnection.cpp b/src/njs/src/njsConnection.cpp index 303249c89..2f877685a 100644 --- a/src/njs/src/njsConnection.cpp +++ b/src/njs/src/njsConnection.cpp @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsConnection.cpp * @@ -1312,14 +1337,14 @@ v8::Handle Connection::GetOutBinds (eBaton* executeBaton) return NanEscapeScope(GetOutBindArray( executeBaton->binds, executeBaton->numOutBinds, executeBaton->stmtIsReturning, - executeBaton->rowsAffected )); + (unsigned long)executeBaton->rowsAffected )); } else { // Binds as JS object return NanEscapeScope(GetOutBindObject( executeBaton->binds, executeBaton->stmtIsReturning, - executeBaton->rowsAffected )); + (unsigned long)executeBaton->rowsAffected )); } } return NanUndefined(); @@ -1900,11 +1925,11 @@ void Connection::cbDynBufferAllocate ( void *ctx, bool dmlReturning, bind->value = (char *)malloc ( ( bind->maxSize + 1) * nRows ) ; if ( dmlReturning ) { - *(bind->len2) = bind->maxSize ; + *(bind->len2) = (unsigned int)bind->maxSize ; } else { - *(bind->len) = bind->maxSize; + *(bind->len) = (unsigned int)bind->maxSize; } break; @@ -1987,7 +2012,7 @@ int Connection::cbDynBufferGet ( void *ctx, DPI_SZ_TYPE nRows, // First time callback, allocate the buffer(s). if ( index == 0 ) { - Connection::cbDynBufferAllocate (ctx, true, nRows ); + Connection::cbDynBufferAllocate (ctx, true, (unsigned long)nRows ); } bind->ind[index] = -1; @@ -1996,7 +2021,7 @@ int Connection::cbDynBufferGet ( void *ctx, DPI_SZ_TYPE nRows, switch ( bind->type ) { case dpi::DpiVarChar: - bind->len2[index] = bind->maxSize; + bind->len2[index] = (unsigned int)bind->maxSize; /* 1 extra char for EOS, 1 extra to determine insufficient buf later */ *bufpp = (void *)&(((char *)bind->value)[ (bind->maxSize) * index]); /* Buffer provided by the application could be small, in this case to diff --git a/src/njs/src/njsConnection.h b/src/njs/src/njsConnection.h index 9239d304b..0ec58be1b 100644 --- a/src/njs/src/njsConnection.h +++ b/src/njs/src/njsConnection.h @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsConnection.h * diff --git a/src/njs/src/njsOracle.cpp b/src/njs/src/njsOracle.cpp index 1f94746ff..50278dd63 100644 --- a/src/njs/src/njsOracle.cpp +++ b/src/njs/src/njsOracle.cpp @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsOracle.cpp * diff --git a/src/njs/src/njsOracle.h b/src/njs/src/njsOracle.h index 67c86d839..c4368c311 100644 --- a/src/njs/src/njsOracle.h +++ b/src/njs/src/njsOracle.h @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsOracle.h * @@ -42,9 +67,9 @@ using namespace node; using namespace v8; -/*0.4.1. Keep the version in sync with package.json */ +/* Keep the version in sync with package.json */ #define NJS_NODE_ORACLEDB_MAJOR 0 -#define NJS_NODE_ORACLEDB_MINOR 5 +#define NJS_NODE_ORACLEDB_MINOR 6 #define NJS_NODE_ORACLEDB_PATCH 0 /* Formula: 10000 x majorversion + 100 * minorversion + patchrelease number */ diff --git a/src/njs/src/njsPool.cpp b/src/njs/src/njsPool.cpp index 9a667026d..c036f37a1 100644 --- a/src/njs/src/njsPool.cpp +++ b/src/njs/src/njsPool.cpp @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsPool.cpp * @@ -155,8 +180,10 @@ Handle Pool::getPoolProperty(Pool* njsPool, unsigned int poolProperty) */ NAN_PROPERTY_GETTER(Pool::GetPoolMin) { + NanEscapableScope(); Pool* njsPool = ObjectWrap::Unwrap(args.Holder()); - NanReturnValue(getPoolProperty(njsPool, njsPool->poolMin_)); + Handle value = getPoolProperty( njsPool, njsPool->poolMin_); + NanReturnValue(value); } /*****************************************************************************/ @@ -166,8 +193,10 @@ NAN_PROPERTY_GETTER(Pool::GetPoolMin) */ NAN_PROPERTY_GETTER(Pool::GetPoolMax) { + NanEscapableScope(); Pool* njsPool = ObjectWrap::Unwrap(args.Holder()); - NanReturnValue( getPoolProperty(njsPool, njsPool->poolMax_)); + Handle value = getPoolProperty( njsPool, njsPool->poolMax_); + NanReturnValue(value); } /*****************************************************************************/ @@ -177,8 +206,10 @@ NAN_PROPERTY_GETTER(Pool::GetPoolMax) */ NAN_PROPERTY_GETTER(Pool::GetPoolIncrement) { + NanEscapableScope(); Pool* njsPool = ObjectWrap::Unwrap(args.Holder()); - NanReturnValue( getPoolProperty(njsPool, njsPool->poolIncrement_)); + Handle value = getPoolProperty( njsPool, njsPool->poolIncrement_); + NanReturnValue(value); } /*****************************************************************************/ @@ -188,8 +219,10 @@ NAN_PROPERTY_GETTER(Pool::GetPoolIncrement) */ NAN_PROPERTY_GETTER(Pool::GetPoolTimeout) { + NanEscapableScope(); Pool* njsPool = ObjectWrap::Unwrap(args.Holder()); - NanReturnValue(getPoolProperty(njsPool, njsPool->poolTimeout_)); + Handle value = getPoolProperty( njsPool, njsPool->poolTimeout_); + NanReturnValue(value); } /*****************************************************************************/ @@ -257,8 +290,10 @@ NAN_PROPERTY_GETTER(Pool::GetConnectionsInUse) */ NAN_PROPERTY_GETTER(Pool::GetStmtCacheSize) { + NanEscapableScope(); Pool* njsPool = ObjectWrap::Unwrap(args.Holder()); - NanReturnValue(getPoolProperty(njsPool, njsPool->stmtCacheSize_)); + Handle value = getPoolProperty( njsPool, njsPool->stmtCacheSize_); + NanReturnValue(value); } /*****************************************************************************/ diff --git a/src/njs/src/njsPool.h b/src/njs/src/njsPool.h index cbcc9e15e..d5c9fadb5 100644 --- a/src/njs/src/njsPool.h +++ b/src/njs/src/njsPool.h @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsPool.h * diff --git a/src/njs/src/njsUtils.h b/src/njs/src/njsUtils.h index e3827d80f..1b232a63e 100644 --- a/src/njs/src/njsUtils.h +++ b/src/njs/src/njsUtils.h @@ -15,6 +15,31 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * This file uses NAN: + * + * Copyright (c) 2015 NAN contributors + * + * NAN contributors listed at https://github.com/rvagg/nan#contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  + * * NAME * njsUtils.h *