I am using oracle database for my nodejs application.
When altering any table, i am getting error resource already in used.
This error getting because when terminating or when exiting the nodejs application the database connection is not getting released or closed.
I know how to release database connection
function doRelease() {
db.close(
function (err) {
if (err)
console.error(err.message);
});
}
But i dont know, how to call the above function on nodejs exit or node terminate??
So i want simple help
how to release db connection when exiting or terminating nodejs application
Any help will be appreciated