为了账号安全,请及时绑定邮箱和手机立即绑定

死锁问题怎么解决

2016-9-1 10:25:53 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

WARN: SQL Error: 1205, SQLState: 41000

2016-9-1 10:25:53 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

ERROR: Lock wait timeout exceeded; try restarting transaction

2016-9-1 10:25:53 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release

INFO: HHH000010: On release of batch it still contained JDBC statements

Exception in thread "main" org.hibernate.exception.LockTimeoutException: could not execute statement

at org.hibernate.dialect.MySQLDialect$1.convert(MySQLDialect.java:447)

at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)

at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:190)

at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:62)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3124)

at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3587)

at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:103)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:453)

at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:345)

at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350)

at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)

at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1218)

at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:421)

at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)

at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)

at com.imooc.entity.Test.add(Test.java:40)

at com.imooc.entity.Test.main(Test.java:22)

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

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375)

at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359)

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:187)

... 14 more


正在回答

3 回答

把数据库服务重启

0 回复 有任何疑惑可以回复我~

怎么解决的,分享一下

0 回复 有任何疑惑可以回复我~

并发处理

【温馨提示:JavaSE/EE、SSH/SSM、Hybrid APP、JQ/JS/CSS3/H5等编程爱好者关注我,加我慕课好友,互相学习,共同进步!】

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Hibernate初探之一对多映射
  • 参与学习       42171    人
  • 解答问题       295    个

Hibernate中一对多关联映射配置,以及cascade和inverse属性作用

进入课程

死锁问题怎么解决

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信