休眠锁定等待问题

| 我们有一个Java应用程序,它侦听原型并将已解析的信息记录到MySql数据库中。我们使用休眠作为ORM层。整个持久性过程由专用线程处理。实体以20组为一组进行插入和更新,在6核24GB-RAM linux机器上,最大插入率为30次插入/秒,最大更新率为30次更新/秒。目前,数据库大小约为16GB。正常运行40分钟后,应用程序会挂起,但以下情况除外:     
org.hibernate.util.JDBCExceptionReporter - SQL Error: 1205, SQLState: 41000
    Lock wait timeout exceeded; try restarting transaction
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute update query
即使该行上存在锁,该线程也绝不能停止,并且如果可能的话,强行释放该行上的锁,我如何保证这种行为?任何帮助将不胜感激。您可以在下面找到我们的休眠配置:
<properties>
  <property name=\"hibernate.connection.driver_class\" value=\"com.mysql.jdbc.Driver\"/>
  <property name=\"hibernate.connection.url\" value=\"jdbc:mysql://**************:3306/*********?useUnicode=yes;characterEncoding=UTF-8;rewriteBatchedStatements=true;includeThreadNamesAsStatementComment=true\"/>
  <property name=\"hibernate.cache.provider_class\" value=\"org.hibernate.cache.NoCacheProvider\"/>
  <property name=\"hibernate.connection.autocommit\" value=\"false\"/>
  <property name=\"hibernate.connection.useUnicode\" value=\"true\"/>
  <property name=\"hibernate.connection.characterEncoding\" value=\"UTF-8\"/>
  <property name=\"hibernate.connection.show_sql\" value=\"true\"/>
  <property name=\"hibernate.connection.provider_class\" value=\"org.hibernate.connection.C3P0ConnectionProvider\"/>
  <property name=\"hibernate.connection.zeroDateTimeBehavior\" value=\"convertToNull\"/>
  <property name=\"hibernate.c3p0.max_size\" value=\"100\"/>
  <property name=\"hibernate.c3p0.min_size\" value=\"0\"/>
  <property name=\"hibernate.c3p0.acquire_increment\" value=\"1\"/>
  <property name=\"hibernate.c3p0.idle_test_period\" value=\"300\"/>
  <property name=\"hibernate.c3p0.max_statements\" value=\"0\"/>
  <property name=\"hibernate.c3p0.timeout\" value=\"100\"/>
  <property name=\"hibernate.c3p0.autoCommitOnClose\" value=\"false\"/>
  <!-- JDBC connection pool (use the built-in) -->
  <!--Hibernate Batch Process Best Practices -->
  <property name=\"hibernate.order_updates\" value=\"true\"/>
  <property name=\"hibernate.order_inserts\" value=\"true\"/>
  <property name=\"hibernate.jdbc.batch_size\" value=\"15\" />
</properties>
    
已邀请:

要回复问题请先登录注册