In this case, there's just one connection to the InnoDB engine right now (my login, running the show query). MySQL thread id 10594, query id 10269885 localhost marc Purge done for trx's n:o < 0 134992 undo n:o < 0 0 It kills the processes' connection and causes MySQL to clean up the mess its left. You won't be able to force a commit or rollback of those transactions, but you CAN kill the MySQL process running them, which does essentially boil down to a rollback. Buried in the wall of output will be the transactions, and what internal process ID they're running under. You can use show innodb status (or show engine innodb status for newer versions of mysql) to get a list of all the actions currently pending inside the InnoDB engine. Make sure you keep your last query (transaction) in the client so that you can resubmit it if need be.Īnd disable auto-reconnect mode, because that is dangerous, implement your own reconnect instead, so that you know when a drop occurs and you can resubmit that query. To check for reconnection, call mysql_thread_id() to get the original connection identifier before calling mysql_ping(), then call mysql_thread_id() again to see whether the identifier has changed. If an automatic reconnection does occur (for example, as a result of calling mysql_ping()), there is no explicit indication of it. This behavior may be dangerous for you, as in the following example where the server was shut down and restarted between the first and second statements without you knowing it: Also, any current transaction rolls back. However, even if mysql succeeds in reconnecting, your first connection has ended and all your previous session objects and settings are lost: temporary tables, the autocommit mode, and user-defined and session variables. If the mysql client loses its connection to the server while sending a statement, it immediately and automatically tries to reconnect once to the server and send the statement again. It will not help you, because you cannot commit a transaction from a broken connection.Ĥ.5.1.6.3. You display threads using SHOW FULL PROCESSLIST ![]() ![]() You cannot commit the transaction (IFAIK). There is no open transaction, MySQL will rollback the transaction upon disconnect. How can I display these open transactions and commit or cancel them?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |