Closed lxneng closed 5 months ago
This is a good idea. I'd make it opt-in though.
SQLAlchemy uses the pool_pre_ping
argument (default False) to enable this behaviour.
https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic
Thanks! Please resolve conflicts first.
Thanks! Please resolve conflicts first.
@long2ice I have resolved all the conflicts. Please review this PR again. Thank you!
Thanks!
_check_conn
is added to check the validity of the connection. This method is used in theacquire
method to ensure only valid connections are acquired from the connection pool.initialize
method to checkfreesize
instead ofsize
.