Our app is written on Java, connected to MySQL using JBDC and iBatis does ORM for us.
Sometimes we have locks: “Lock wait timeout exceeded; try restarting transaction”.
We can restart transaction but we really want to know which object been locked by which transaction.
We can use “SHOW INNODB STATUS” is case of such errors but we do not want to reinvent the wheel.
Probably there is a way to configure MySQL to log that fact?