ckyycc / hdb-pool Goto Github PK
View Code? Open in Web Editor NEWSAP HANA Database Connection Pool for Node.js
Home Page: https://www.npmjs.com/package/hdb-pool
License: MIT License
SAP HANA Database Connection Pool for Node.js
Home Page: https://www.npmjs.com/package/hdb-pool
License: MIT License
Event listeners are not removed when the connection is closed and pool.clear()
is triggered.
I'm using typeorm SapDriver, and when the connection is opened and then closed over 10 times (in tests) than I'm getting this warning:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 poolError listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
Also it seems that PoolManager.eventEmitter()
shouldn't be a static method, because in case of multi-tenants scenario, errors will be shown for every tenant connection.
Hi Team,
Firstly I would like to thank you for developing this module! It is very much helpful because it supports both hdb and @sap/hana-client module.
I am using the hdb module for database connections but the whitesource scans are failing because hdb-pool has a peer dependency on @sap/hana-client module.
Due to a known bug in hana-client module I am forced to use hdb module.
Could you please help me tackle this?
Thank you!
We recently had what seems like a connection hiccup to our HANA database (connection reset). While the database was reachable shortly after, it seems like all connections in the pool failed and did not recover, leading to a downtime.
Can you comment on the intended behavior? What can we do to make sure the pool automatically recovers from such failures and connections are correctly invalidated and recreated? I was unable to find information on this topic.
We are using hdb-pool
in the context of typeorm
.
Thanks!
The full explanation for this issue can be found here.
Basically, when using yarn with pnp, yarn is really strict with dependency management, so you should not require dependencies which are not correctly declared in the package.json. As of now, hdb-pool requires @sap/hana-client in Utils but it does not declare it as a dependency in the package.json, only as a devDependency.
Because of this, a yarn pnp project trying to use any package that depends on hdb-pool (like typeorm) will fail and it needs to do a workaround in .yarnrc.yml:
...
packageExtensions:
"hdb-pool@^0.1.6":
dependencies:
"@sap/hana-client": "^2.9.28"
To fix this, please just move hdb-pool from a devDependency to a dependency. For now, I'm not sure if any other package should also make this move.
I would like to pass extra dbParams like encryption. Currently this is not possible.
I can create a pull request to fix it.
During execution of method getConnection() on pool object, we receive the below error
"Request timeout. Request info: (id: 54, creation time: 1599638811640)","type":"log","custom_fields":{"stack":"Error: Request timeout. Request info: (id: 54, creation time: 1599638811640)\n at Request._fireTimeout (/home/vcap/app/node_modules/hdb-pool/lib/Request.js:114:17)\n at Timeout. (/home/vcap/app/node_modules/hdb-pool/lib/Request.js:92:43)\n at listOnTimeout (internal/timers.js:549:17)\n at processTimers (internal/timers.js:492:7)"}}
As this is sporadically occurring, I am not quite sure what causes this issue. The only way to resolve this as of now is to re-start the application.
Pool status object
"pool":"{"size":0,"min":2,"max":10,"available":0,"timeout":0}","request":"{"number":1,"pending":0,"max":0,"resolved":53,"rejected":0,"timeout":2}"}
Could you please help me understand how can we resolve this? This is causing downtime for our application.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.