Dangling Transactions in MySQL Innodb

被刻印的时光 ゝ 提交于 2019-12-23 21:04:45

问题


Suppose that I execute the following SQL statements:

start transaction;
insert into someTable (userId, amount) values (33, 44);

Notice that there is no Commit or Rollback at the end of this statement. I also do not have the option of requiring autoCommit being enabled.

How can a dba detect this sort of unfinished transaction? I've tried using 'show innodb status' but it provides too much information. I'm trying to find uncommitted transactions and force them to commit or rollback.

Thanks.


回答1:


Autocommit will not help you here, start transaction overrides it.

The dangling transactions will be rolled back as soon as the connection times out OR the client reconnects, whichever happens first.
There is no way to commit a dangling transaction, the only possible option is a rollback.

If you want to understand the InnoDB status output, see:
http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/



来源:https://stackoverflow.com/questions/7851061/dangling-transactions-in-mysql-innodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!