I developed and deployed a Node.js application at the edge of apigee, which performs several CRUD operations. To establish a db connection, I used the trireme-jdbc Node.js. module I can do all CRUD operations through trireme-jdbc, but I have a problem closing my DB session using the db.close () function in trireme-jdbc. When I use db.close (), it does not close the current active / open session from the pool. I want to know if there is any other process or way to completely close the db connection. I also want to close all active connections from the pool.
Any help would be appreciated. The following is sample code to establish a connection, execute a select query, and use db.close () to close the session. My database is Openedge / Progress.
var jdbc = require('trireme-jdbc');
var db = new jdbc.Database({
url : connectionURL,
properties: {
user: 'XXXXXX',
password: 'XXXXXX',
},
minConnections:1,
maxConnections:2,
idleTimeout:10
});
db.execute('select * from users ', function(err, result, rows) {
console.log(err);
console.log(result);
rows.forEach(function(row) {
console.log(row);
});
db.close();
});
source
share