sfackler / r2d2

A generic connection pool for Rust
Apache License 2.0
1.51k stars 82 forks source link

Is there a way to drop all connections? #101

Open zhangli-pear opened 4 years ago

zhangli-pear commented 4 years ago

I'm using Sqlite, and it sometime has integrity problems. When this happen, I simply delete the file. However there are some connections still open the database, it can not be deleted.

Is this problem can be solved? in any way?

sfackler commented 4 years ago

I'd probably just replace the entire pool.

zhangli-pear commented 4 years ago

I did try this way, but it seems doesn't work. Maybe connections didn't get dropped immediately?

sfackler commented 4 years ago

There can be some operations running in the background that would hold onto connections for a little bit after the pool drops.

bkontur commented 4 years ago

I would also need something like this. I would like to destroy pool manually and be sure, that CustomizeConnection.on_release is trigger on every connection. Is there any possibility right now? Thx

link2xt commented 2 years ago

I did try this way, but it seems doesn't work. Maybe connections didn't get dropped immediately?

There is an open bug about it: #99