mysql死锁

Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3361)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3295)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1852)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1975)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2476)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1583)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1859)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1777)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1762)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
	at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:101)
	... 10 more
com.zhongrx.base.exception.BusinessException: err.base.0001


 

 

"try restarting transaction"
这是事务之间的关系存在问题,比如说事务嵌套等等
请楼主仔细看一下开启事务和commit事务的代码,一次开启和一次提交之间有没有
开新的事务等等。。 

 

你可能感兴趣的:(java,sql,mysql,Hibernate,jdbc)