Open crlome opened 6 years ago
I think the error is that the ConnectionManager.prototype.initPools function of the \cu8-sequelize-oracle\lib\dialects\abstract\connection-manager.js file has a _this.lib.createPool function that does an asynchronous , Then when I try to run findAll, the pool is not yet created, any idea how to solve this?
Here is the solution or rather workaround I believe: https://github.com/nhuanhoangduc/cu8-sequelize-oracle/pull/5
Still not working ! Updated for last version ! This error: (node:16200) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getConnection' of undefined at D:\licenca\myapp\node_modules\cu8-sequelize-oracle\lib\dialects\abstract\connection-manager.js:73:19
Still not working, too
i installed cu8-sequelize-oracle@1.0.5, but the fix code doens't be included in this version. Please release new version...(This Problem is fatal)
I leave temporary solution here(Written by rpavez Rodrigo on cu8-sequelize-oracle Contributor)
Replace the ConnectionManager.prototype.getConnection function to this code
ConnectionManager.prototype.getConnection = function(options) {
var self = this;
options = options || {};
// this.pool._logStats();
function checkIfPoolDefined(callback) {
if(self.pool) {
{ callback() }
}
else {
console.log("Waiting for pool...")
setTimeout(function() {
checkIfPoolDefined(callback);
}, 250);
}
}
return new Promise(function(resolve, reject) {
checkIfPoolDefined(function() {
self.pool.getConnection((err, connection) => {
if (err) {
reject(err);
return;
}
resolve(connection);
});
})
});
};
When I try to execute a select it marks the following error:
My code is:
======================================= When I test with native oracledb, everything works fine