trireme-jdbc
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -72,3 +72,3 @@ /* | ||
// Pool full -- close! | ||
closeItem(o); | ||
this._closeItem(o); | ||
@@ -95,5 +95,4 @@ } else { | ||
Pool.prototype.discard = function(o) { | ||
closeItem(o, function() { | ||
}); | ||
Pool.prototype.discard = function(o, cb) { | ||
this._closeItem(o, cb); | ||
}; | ||
@@ -108,3 +107,3 @@ | ||
if (o) { | ||
closeItem(o, function() { | ||
self._closeItem(o, function() { | ||
doClose(self, cb); | ||
@@ -127,3 +126,3 @@ }); | ||
if (now >= (this.pool[0]._idleTime + this.idleTimeout)) { | ||
closeItem(this.pool.shift()); | ||
this._closeItem(this.pool.shift()); | ||
} else { | ||
@@ -135,2 +134,14 @@ break; | ||
Pool.prototype._closeItem = function(o, cb) { | ||
var self = this; | ||
if (o.close) { | ||
o.close(function() { | ||
self.allocated--; | ||
if (cb) { | ||
cb(); | ||
} | ||
}); | ||
} | ||
}; | ||
function closeItem(o, cb) { | ||
@@ -137,0 +148,0 @@ if (o.close) { |
@@ -85,3 +85,3 @@ /* | ||
max: opts.maxConnections, | ||
idleTimeout: opts.idleTimeout * 1000, | ||
idleTimeout: opts.idleTimeout, | ||
create: function(cb) { | ||
@@ -88,0 +88,0 @@ if (debugEnabled) { |
{ | ||
"name": "trireme-jdbc", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Connect to JDBC databases from inside Trireme", | ||
@@ -10,3 +10,3 @@ "main": "lib/trireme-jdbc.js", | ||
"scripts": { | ||
"test": "trireme mocha -R spec" | ||
"test": "export TRIREME_CLASSPATH=$PWD/drivers/hsqldb-2.3.2.jar; ./node_modules/trireme/bin/trireme node_modules/mocha/bin/mocha -R spec" | ||
}, | ||
@@ -31,3 +31,7 @@ "repository": { | ||
"semver": "~4.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.0.1", | ||
"trireme": ">0.8.2" | ||
} | ||
} |
@@ -266,5 +266,7 @@ # Trireme JDBC | ||
The tests are written in Mocha but won't work because Mocha doesn't support | ||
Node. Instead, do the following: | ||
"npm test" will test this module using the Trireme binary that it depends | ||
on, and also using the HSQLDB driver included with the distribution. | ||
In order to test with another database, do the following: | ||
1. Edit "testconf/config.js" to reflect your database. Default is hsqldb. | ||
@@ -274,3 +276,3 @@ 2. Get your JDBC driver and put it somewhere. For instance, the "drivers" directory. | ||
JDBC driver JAR from the previous step. | ||
4. Run "mocha" with "trireme" rather than just running mocha. Better to show that... | ||
4. Run "mocha" with "trireme" rather than just running mocha. | ||
@@ -277,0 +279,0 @@ For example: |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27556
476
284
2
1