node-jdbc icon indicating copy to clipboard operation
node-jdbc copied to clipboard

Allow for queries to queue waiting for connections to be released back to the pool

Open dnnyz opened this issue 7 years ago • 4 comments

Hi, I would like to understand what should happened when the pool size is reached. Does it supposed to throw exception or there is a waiting queue.

Sincerely, Danny

dnnyz avatar May 09 '17 10:05 dnnyz

It appears the default at least is to not wait for a connection but to error out immediately. I really need a waiting queue to avoid lost queries. Is there anything built into node-jdbc to wait for connections from the pool instead?

briancray avatar Oct 10 '17 15:10 briancray

There is not. It is a very basic pool. I will have some time after the first of the year to look into making the pool more robust.

CraZySacX avatar Dec 02 '17 00:12 CraZySacX

Looking briefly at the pooling code, have you considered keeping an async queue object, and using that to maintain connections?

https://caolan.github.io/async/docs.html#queue

The queue object that's returned appears to hold enough state that you can expire connections and such.

https://caolan.github.io/async/docs.html#QueueObject

briancray avatar Dec 02 '17 13:12 briancray

Is there any update on this ticket? The latest version still throws error when the maximum pool size is hit, just want to check if there is anything implemented on this front. Thanks!

ntallapa12 avatar Jul 25 '18 16:07 ntallapa12