OrientDB.ConnectionError [10]
const boostrap = pool => {
app.use((req, res, next) => {
pool
.acquire()
.then(session => {
res.locals.db = session;
res.on('end', () => {
console.log('end : closing db session...');
if (session) {
session.close();
session = null;
};
});
res.on('close', () => {
console.log('close : closing db session...');
if (session) {
session.close();
session = null;
};
});
res.on('finish', () => {
console.log('finish : closing db session...');
if (session) {
session.close();
session = null;
};
});
next();
})
.catch(err => {
console.log('err : closing db session...');
if (session) {
session.close();
session = null;
};
res.status(500).send(err);
});
});