multiple orawrap execute - takes more time to release connection
Hi,
orawrap.execute( "select * from table", {}, { outFormat : oracledb.OBJECT }, function (err, result) { if (err) { reply(err); return; } if (result.rows.length > 0) { //do something } });
1st Rest call : orawrap.execute(...., callback1); 2nd Rest call orawrap.execute(...., callback2);
Consider table has only 5 rows.
The above code works fine, when I trigger 1st rest call one time and it takes total 200 ms to load and to release connection it takes 5ms.
If I trigger 1st rest call and 2nd rest call simultaneously without using async or promise, it takes 10s,20s to release two connections as I checked release time inside connectionmanager.js.
If I further execute the queries without waiting for releasing time, after 3 or 4 execution, getconn takes 18s to comeback.
what might be the problem ?
Note : I tried with manual release by setting autoRelease : false and I face same time delay issue in releasing the conn.
Hi @sivacreatives, that is very strange indeed. With a simple select I don't see how this could happen. However, I should say that this project is not being maintained anymore. I've been working to bring the best features of Orawrap into the driver itself. There's still work to be done, but I'd recommend using the core driver. Do you experience this behavior with the core driver?
nope. I am not facing this issue when using node-oracledb(https://github.com/oracle/node-oracledb). Also is there possibilities that it might be connection problem ?
Yeah, I suppose it's possible. But this project will not be maintained going forward. I would recommend switching to the core driver.
hi am facing this issue when using pool with node-oracledb. Without pool it works fine. below is my configuration.
var config = {
user: 'user',
password: 'pass',
connectString: 'localhost',
poolMax: 10,
poolMin: 1,
poolIncrement: 2,
poolTimeout: 10
}
//create pool
oracledb.createPool(dbConfig, function(err, pool) {
if (err) throw err;
oracledb.getPool = pool;
server.start(function (error) {
if (error) {
console.log('Failed to start server', error);
}
});
});
//connect with pool
oracledb.getPool.getConnection(function (err, connection) {
connection.execute("select * from table", {}, {
outFormat: oracledb.OBJECT // Return the result as Object
}, function (err, result) {
connection.release(
function (err) {
if (err) {
console.error(err.message);
}
});
});
});
Let's use the thread you posed there: https://github.com/oracle/node-oracledb/issues/398