Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Pool should allow disposing all connections #101

Closed
schveiguy opened this issue Nov 6, 2018 · 3 comments

Comments

@schveiguy
Copy link

commented Nov 6, 2018

IMO, the whole point of using a connection pool is to both limit the number of concurrent connections, and avoid reconnecting every time you need one.

In my code, I'm leaving the connection to the database open so that I don't have to reconnect every time I fetch a locked connection.

The result of this is when my server shuts down, I get warnings about stale file descriptors. I'd like to close these open connections in a static destructor, but there is no mechanism to do this reliably! A dispose method would be really useful here. Or even a mechanism to iterate over all the allocated connections, as ConnectionPool doesn't really know how to use the Connection.

@s-ludwig

This comment has been minimized.

Copy link
Member

commented Apr 1, 2019

Fixed by #143.

@s-ludwig s-ludwig closed this Apr 1, 2019
@schveiguy

This comment has been minimized.

Copy link
Author

commented Apr 1, 2019

Thanks! Will hopefully get rid of those pesky open connection warnings.

@s-ludwig

This comment has been minimized.

Copy link
Member

commented Apr 13, 2019

For reference, related changes in the vibe.d repo: vibe-d/vibe.d#2287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.