Lock wait timeout exceeded try restarting transaction

1.Symptom
When running application using mysql as database with high load you maybe get following exception

Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

2.Cause
This happend cause your application try to lock resource on database but cannot get that before reach to lock wait time configure of your database.
3.Solution
To fix this issue once quick solution before you can tunning your application is increase lock wait time of mysql database.

  • Find mysql configuration file( in linux it usually in /etc/my.cnf, if you use windows read this post to find it)
  • Increase below value if exist or add parameter with approriate value
innodb_lock_wait_timeout=your_value

 

Leave a Reply