Open
Description
Problem
Today, there is no way how to reliably reset connection. So when connection is returned to the connection pool (or reused from the pool), there can be transaction pending, locks hold, temporary tables being present, session variables set, ...
Describe the solution you'd like
The cheap way how to reset connection is to use COM_RESET_CONNECTION
utility command.
Describe alternatives you've considered
Alternatively, connection can be re-opened every time. This is prohibitively expensive. Or ROLLBACK
can be issued, but that doesn't solve all the issues (e.g. session variables being set).
Context