Lock wait timeout exceeded try restarting transaction

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

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.
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


Leave a Reply