2016-09-14 82 views
0

我在服務器上發佈了大約9-10條消息,但是其中很少沒有成功發佈。它在log中給出以下錯誤。請幫助我。我沒有得到這計劃的一部分是給這個問題org.hibernate.exception.LockAcquisitionException:無法插入

對數

ERROR [org.hibernate.util.JDBCExceptionReporter] (WorkManager(2)-4) Transaction (Process ID 112) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. 


2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at sun.reflect.GeneratedMethodAccessor1065.invoke(Unknown Source) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at java.lang.reflect.Method.invoke(Method.java:597) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_386555905.invoke(InvocationContextInterceptor_z_fillMethod_386555905.java) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_386555905.invoke(InvocationContextInterceptor_z_setup_386555905.java) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) 

***2016-08-02 17:25:22,449 ERROR [com.rt1.ejb.dao.DataHandler] (WorkManager(2)-4) insertHistory(HistoryBean historyBean)org.hibernate.exception.LockAcquisitionException: could not insert: 
some entity name*** 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) 

2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126) 
2016-08-02 17:25:22,449 ERROR [STDERR] (WorkManager(2)-31) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194) 

回答

0

正如在問題查找任何可能的死鎖提。你正在使用哪個數據庫?它是多線程環境嗎?

低於設定休眠的兩個屬性

hibernate.order_updates =真

hibernate.order_inserts =真

+0

我使用SQL數據庫 – maria123

+0

我假設你正在使用SQL Server數據庫使用的sp_who命令檢查鎖表。 –