6

我在我的应用程序 Hibernate 3 和 JBoss 中使用。

在我的应用程序中随机发生 LockAcquisition。

如何处理?

这是堆栈跟踪(但每次它没有出现在这个地方时,它都是不同的)

13:49:45,941 INFO  [stdout] (http--0.0.0.0-8080-4)
13:49:49,962 WARN  [org.hibernate.util.JDBCExceptionReporter] (http--0.0.0.0-8080-4) SQL Error: 1205, SQLState: 40001
13:49:49,963 ERROR [org.hibernate.util.JDBCExceptionReporter] (http--0.0.0.0-8080-4) Transaction (Process ID 90) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun t
he transaction.
13:49:49,967 INFO  [stdout] (http--0.0.0.0-8080-4) Error Occurred While loadActivitiesFromActivitySchedule method.
13:49:49,972 ERROR [stderr] (http--0.0.0.0-8080-4) org.hibernate.exception.LockAcquisitionException: could not execute query
13:49:49,973 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:82)
13:49:49,975 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
13:49:49,977 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.doList(Loader.java:2223)
13:49:49,978 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
13:49:49,980 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.list(Loader.java:2099)
13:49:49,981 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
13:49:49,983 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
13:49:49,984 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)



13:49:50,025 ERROR [stderr] (http--0.0.0.0-8080-4) Caused by: java.sql.SQLException: Transaction (Process ID 90) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun t
he transaction.
13:49:50,027 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
13:49:50,028 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
13:49:50,029 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
13:49:50,030 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.TdsCore.isDataInResultSet(TdsCore.java:796)
13:49:50,030 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.JtdsResultSet.<init>(JtdsResultSet.java:134)
13:49:50,031 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:483)
13:49:50,032 ERROR [stderr] (http--0.0.0.0-8080-4)      at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:776)
13:49:50,034 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
13:49:50,035 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
13:49:50,036 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.doQuery(Loader.java:674)
13:49:50,037 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
13:49:50,038 ERROR [stderr] (http--0.0.0.0-8080-4)      at org.hibernate.loader.Loader.doList(Loader.java:2220)
13:49:50,038 ERROR [stderr] (http--0.0.0.0-8080-4)      ... 42 more
4

0 回答 0