mysql锁的问题,求解决办法。
org.springframework.dao.CannotAcquireLockException:PreparedStatementCallback;SQL[upda...
org.springframework.dao.CannotAcquireLockException: PreparedStatementCallback; SQL [update task_info set state = ? where user_id = ? and name = ?]; Lock wait timeout exceeded; try restarting transaction; nested exception is java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:745)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:538)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:739)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:797)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:805)
at com.dao.main.impl.TimerMainImpl.updateState(TimerMainImpl.java:600)
at com.util.War.startWar(War.java:336)
at com.servlet.timer.MarchTimerServlet.xingjun(MarchTimerServlet.java:218)
at MarchTimerMainServlet.main(MarchTimerMainServlet.java:53) 展开
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:745)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:538)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:739)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:797)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:805)
at com.dao.main.impl.TimerMainImpl.updateState(TimerMainImpl.java:600)
at com.util.War.startWar(War.java:336)
at com.servlet.timer.MarchTimerServlet.xingjun(MarchTimerServlet.java:218)
at MarchTimerMainServlet.main(MarchTimerMainServlet.java:53) 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询