ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
189 stars 151 forks source link

Idle/Unused Pool connections are never closed #93

Closed agov closed 8 years ago

agov commented 8 years ago

Pool connections can stack up quickly during a peak, there is no feature to close them. (only by closing the Pool itself)

neurotech commented 8 years ago

@agov How do you keep track of connections and whether they are open/closed?

agov commented 8 years ago

@neurotech Tracking is already implemented, it provides the main functionality of Pools. Each Pool instance has an availablePools and a usedPools array.

neurotech commented 8 years ago

@agov Ah okay. I thought you were monitoring your machine's network connection using some kind of separate software.

agov commented 8 years ago

@bimalkjha what is the reason for closing the issue please?

bimalkjha commented 8 years ago

@agov Seems you have already enhanced the code to serve your purpose, hence closed the issue. Btw, we already have pool.close() function to close all pooled connections. Why connection should get closed automatically unless user want to close it? Your requirement and issue #86 contradicts each other. Hope it clarifies. Thanks.

bimalkjha commented 8 years ago

@agov please help us by providing info here: http://goo.gl/forms/EKzg7A6HZw . Thanks.

agov commented 8 years ago

@bimalkjha The two issues are different. My concern is that if you maintain high availability pool, it may open up many connections on a high usage peak. (eg. a monthly report) These connections are never closed, they use resources (memory, connection, dynamic statement cache) on the database side. In case the application is billed based on resource usage (eg. cloud systems), it may even be financially unfavorable.

rhtpandeyIN commented 8 years ago

@agov
I checked your code changes and tried to build with main branch code but it is failing. we are processing your changes and looking for the issues. due to your changes older test cases are not working so we have to modify your changes as well to support with older code. and Thanks for your efforts and time.

Chandragandla commented 8 years ago

Any update on this? Why is this closed?

Thanks

rhtpandeyIN commented 8 years ago

Update: @Chandragandla, Issue is fixed now. @agov , pull request accepted and code merged. Thanks for your time & efforts.