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.
解决方案
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.