GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Best way to monitor InnoDB locks

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best way to monitor InnoDB locks

    Hello.

    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?

  • #2
    The data in "show (engine) innodb status" is your best bet. I would enable the innodb_monitor (CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; in the mysql database). That will continually output the InnoDB status to your error log, so you can then go back and review it for the time period in question after the fact.

    Comment


    • #3
      Thanks!

      I've enabled innodb monitor and general log. Will try to investigate locks

      Comment

      Working...
      X