Unless step 6 is reached and completed if the client closed then I would expect the database server to detect the closed connection and rollback on its own since there is no way to recover the state built on that connection or if the database server is restarted then the database server should perform startup recovery and rollback anything that isn't completed but the client still needs to clean up.
What this smells like is a connection pool will hold open connections for reuse, the database server is restarted because of a maintenance script and now the pool has stale connections. When one of these pooled connections is given to a user task the connection should be detected as stale in the pool logic and a reconnect attempted before handing it over to the user. What Alvaro describes is similar but it looks like the DAL won't initiate a new connection after a server restart unless a ping is performed. Is it possible there is state being held in the DAL or the mysqldb driver that says there is a connection but is not cleared to allow an attempt to get a fresh open on the database?