How to Avoid Lock wait timeout exceeded exception.?

前端 未结 7 1320
独厮守ぢ
独厮守ぢ 2020-12-09 10:32
    java.sql.SQLException: Lock wait timeout exceeded; try restarting tra
nsaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
        at com.m         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 11:03

    Make sure the database tables are using InnoDB storage engine and READ-COMMITTED transaction isolation level.

    You can check it by SELECT @@GLOBAL.tx_isolation, @@tx_isolation; on mysql console.

    If it is not set to be READ-COMMITTED then you must set it. Make sure before setting it that you have SUPER privileges in mysql.

    You can take help from http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html.

    By setting this I think your problem will get solved.

    Thank You.

提交回复
热议问题