Thanks for your response. So, when calling close() on an SQLAlchemy
connection, it is returned to the connection pool, but the MySQL connection
is not actually closed. That makes sense.

Could you elaborate on your comment about garbage collection? My
application is short-lived: it sets up the engine, executes a few queries,
and the script -and thus the Python process- ends. I'm not even sure
pooling makes sense for my use case, but just so I understand: why
shouldn't I call dispose() on the engine to close the MySQL connections,
and instead rely on MySQL to close those connections? Isn't MySQL's
connection close logic meant for misbehaving applications that don't
properly close connections?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CALC%3Dt6-VW0kKh3sR3W0doP9mRjxgGsdd9LY7sgM7daEbtwCr5g%40mail.gmail.com.

Reply via email to