MySQL Innodb 中的悬空事务
假设我执行以下 SQL 语句:
start transaction;
insert into someTable (userId, amount) values (33, 44);
请注意,该语句末尾没有 Commit 或 Rollback。我也没有要求启用自动提交的选项。
dba 如何检测这种未完成的事务?我尝试过使用“show innodb status”,但它提供了太多信息。我试图找到未提交的事务并强制它们提交或回滚。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自动提交在这里不会为您提供帮助,
开始事务
会覆盖它。一旦连接超时或客户端重新连接(以先发生者为准),悬空事务将回滚。
没有办法提交悬空事务,唯一可能的选择是回滚。
如果你想了解InnoDB状态输出,请参阅:
http://www.mysqlperformanceblog.com/2006/ 07/17/show-innodb-status-walk-through/
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/