Closed Ereski closed 7 years ago
Updated pull request with drop_conn
(renamed drop_conns
) taking a vector of connections to drop by value.
This updated request has on_release()
taking ownership of the connection, as you've been insisting. May I just point out that this allows the user to retain the connection indefinetly, or drop it when the internals
lock guard is alive.
I don't see why it would be a bad thing to let people hold onto old connections in the 0% chance they want to.
How does it allow the connection to be dropped while the lock is held? It seems pretty explicitly unlocked before the connection set is cleared.
CustomizeConnection::on_release() will be called with a connection before it is dropped. This can be useful for logging, benchmarking, or RDBMS-specific functionality, such as SQLite's PRAGMA optimize.
(note that I don't fully understand the utility of the
DROPPED
flag intest_connection_customizer()
, so I'm not 100% sure the test is working as expected)