jbpm4下 等待资源时检测到死锁
wodemajia
2011-07-26
在网上搜索了半天,还没搞定,哪位有这方面经验告知一二,多谢
org.hibernate.exception.LockAcquisitionException: could not delete: [org.jbpm.pvm.internal.task.TaskImpl#5191218] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:87) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2546) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2702) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:77) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1562) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283) at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305) at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:311) at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:130) at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:116) at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:70) at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672) at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632) at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:430) at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:416) at sun.reflect.GeneratedMethodAccessor3038.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157) at org.jbpm.pvm.internal.model.ExecutionImpl$$EnhancerByCGLIB$$87e323ca.signal(<generated>) at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:201) at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:65) at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32) at org.jbpm.pvm.internal.cmd.CompositeCmd.execute(CompositeCmd.java:42) at org.jbpm.pvm.internal.cmd.CompositeCmd.execute(CompositeCmd.java:34) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56) at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:105) 。。。。。。。。。。。。。。。。。。。 Caused by: java.sql.SQLException: ORA-00060: 等待资源时检测到死锁 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2528) ... 119 more |
|
guofengcn
2011-07-26
你是不是开启jobexecutor了?
|
|
wodemajia
2011-07-27
没开启哇。
|
|
bigsurge
2011-08-23
问题解决了吗?
|
|
wodemajia
2011-08-26
很遗憾,还没有哇
|
|
alibubu
2011-08-31
我也碰到这个问题,错误和你的一模一样,正在郁闷中。你的这个事务执行时间长吗?
|
|
alibubu
2011-09-08
你好,经过N天的摸索,加上同事的努力,现在已经解决了。我的办法是,在jbpm4_variable表上给外键FK_VAR_TASK建上相应的索引,问题即可解决。原理是这样的:当往子表中插入数据后还未提交前,oracle会锁住它父表,导致父表不能做删除操作。而jbpm正是需要先往jbpm4_variable表插入数据,然后在jbpm4_task表删除数据,于是会导致一直等待。并发一上来,就死锁了。要避免这种情况,只需给外键加上相应的索引即可。oracle就是这样设计的。
|
|
wodemajia
2011-09-12
多谢多谢啊
|
|
feng198526
2012-11-26
wodemajia 写道 多谢多谢啊
请问你那里的问题解决了吗? |
|
wodemajia
2012-12-07
解决了,就是通过给所有的外键加上索引
|