node-jdbc
node-jdbc copied to clipboard
Allow for queries to queue waiting for connections to be released back to the pool
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
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?
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.
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
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!