Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
MICHAIL MOUDATSOS
Kaleo: db lock error when submitting a WebContent using a fork
May 26, 2013 10:31 PM
Answer

MICHAIL MOUDATSOS

Rank: Regular Member

Posts: 110

Join Date: October 4, 2011

Recent Posts

Hello all,

In a Liferay 6.1 CE GA2 installation, I downloaded and installed kaleo-web using the Marketplace.

I created a workflow definition xml file (attached as content-view-approval.xml).

I installed my definition through Control Panel

Then I setup any Web Content creation to go through my workflow definition

I create a sample web content and when I'm pressing "Submit for Publication" the follwing error is shown on tomcat console (also attached, as submit.txt):
  110:46:15,621 ERROR [liferay/kaleo_graph_walker-1][JDBCExceptionReporter:76] Transaction (Process ID 93) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
  210:46:15,629 ERROR [liferay/kaleo_graph_walker-1][ParallelDestination:117] Unable to process message {destinationName=liferay/kaleo_graph_walker, response=null, responseDestinationName=null, responseId=null, payload=com.liferay.portal.workflow.kaleo.runtime.graph.PathElement@1875f21, values={principalPassword =null, principalName=10196, companyId=10154}}
  3com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.LockAcquisitionException: could not execute query
  4        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:31)
  5        at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
  6        at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:114)
  7        at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:671)
  8        at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:582)
  9        at java.lang.Thread.run(Thread.java:619)
 10Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.LockAcquisitionException: could not execute query
 11        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
 12        at com.liferay.portal.workflow.kaleo.service.persistence.KaleoTaskAssignmentInstancePersistenceImpl.findBykaleoTaskInstanceTokenId(KaleoTaskAssignmentInstancePersistenceImpl.java:1930)
 13        at com.liferay.portal.workflow.kaleo.service.persistence.KaleoTaskAssignmentInstancePersistenceImpl.findBykaleoTaskInstanceTokenId(KaleoTaskAssignmentInstancePersistenceImpl.java:1818)
 14        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 15        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 16        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 17        at java.lang.reflect.Method.invoke(Method.java:597)
 18        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
 19        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 20        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 21        at com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice.invoke(ShardPersistenceAdvice.java:52)
 22        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 23        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
 24        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 25        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 26        at $Proxy446.findBykaleoTaskInstanceTokenId(Unknown Source)
 27        at com.liferay.portal.workflow.kaleo.service.impl.KaleoTaskAssignmentInstanceLocalServiceImpl.getKaleoTaskAssignmentInstances(KaleoTaskAssignmentInstanceLocalServiceImpl.java:215)
 28        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 29        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 30        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 31        at java.lang.reflect.Method.invoke(Method.java:597)
 32        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
 33        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 34        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
 35        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 36        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 37        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
 38        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 39        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 40        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 41        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 42        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 43        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 44        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 45        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 46        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 47        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 48        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 49        at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51)
 50        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 51        at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
 52        at $Proxy474.getKaleoTaskAssignmentInstances(Unknown Source)
 53        at com.liferay.portal.workflow.kaleo.service.KaleoTaskAssignmentInstanceLocalServiceUtil.getKaleoTaskAssignmentInstances(KaleoTaskAssignmentInstanceLocalServiceUtil.java:361)
 54        at com.liferay.portal.workflow.kaleo.model.impl.KaleoTaskInstanceTokenImpl.getKaleoTaskAssignmentInstances(KaleoTaskInstanceTokenImpl.java:51)
 55        at com.liferay.portal.workflow.kaleo.service.impl.KaleoLogLocalServiceImpl.addTaskAssignmentKaleoLog(KaleoLogLocalServiceImpl.java:171)
 56        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 57        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 58        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 59        at java.lang.reflect.Method.invoke(Method.java:597)
 60        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
 61        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 62        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
 63        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 64        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 65        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
 66        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 67        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 68        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 69        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 70        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 71        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 72        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 73        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 74        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 75        at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
 76        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
 77        at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
 78        at $Proxy462.addTaskAssignmentKaleoLog(Unknown Source)
 79        at com.liferay.portal.workflow.kaleo.runtime.node.TaskNodeExecutor.doEnter(TaskNodeExecutor.java:165)
 80        at com.liferay.portal.workflow.kaleo.runtime.node.BaseNodeExecutor.enter(BaseNodeExecutor.java:49)
 81        at com.liferay.portal.workflow.kaleo.runtime.graph.DefaultGraphWalker.follow(DefaultGraphWalker.java:62)
 82        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 83        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 84        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 85        at java.lang.reflect.Method.invoke(Method.java:597)
 86        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
 87        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
 88        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
 89        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
 90        at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
 91        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 92        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
 93        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
 94        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
 95        at $Proxy489.follow(Unknown Source)
 96        at com.liferay.portal.workflow.kaleo.runtime.graph.messaging.PathElementMessageListener.doReceive(PathElementMessageListener.java:54)
 97        at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:25)
 98        ... 5 more
 99Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.LockAcquisitionException: could not execute query
100        at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
101        at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:98)
102        at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:79)
103        at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:169)
104        at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:161)
105        at com.liferay.portal.workflow.kaleo.service.persistence.KaleoTaskAssignmentInstancePersistenceImpl.findBykaleoTaskInstanceTokenId(KaleoTaskAssignmentInstancePersistenceImpl.java:1926)
106        ... 90 more
107Caused by: org.hibernate.exception.LockAcquisitionException: could not execute query
108        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:107)
109        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
110        at org.hibernate.loader.Loader.doList(Loader.java:2545)
111        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
112        at org.hibernate.loader.Loader.list(Loader.java:2271)
113        at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:940)
114        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
115        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
116        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
117        at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:86)
118        ... 94 more
119Caused by: java.sql.SQLException: Transaction (Process ID 93) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
120        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
121        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
122        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
123        at net.sourceforge.jtds.jdbc.TdsCore.isDataInResultSet(TdsCore.java:796)
124        at net.sourceforge.jtds.jdbc.JtdsResultSet.<init>(JtdsResultSet.java:134)
125        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:483)
126        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:776)
127        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
128        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
129        at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
130        at org.hibernate.loader.Loader.doQuery(Loader.java:802)
131        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
132        at org.hibernate.loader.Loader.doList(Loader.java:2542)
133        ... 101 more

Notes:
-I'm using MS SQL Server
-This error is NOT thrown when I'm using the Single Approver Definition that is bundled with kaleo-web
-I use a fork and join state, which is where my definition differs from the Single Approve one; after the creation of the object to be put under workflow, the workflow forks to two tasks, where each task is assigned to two different roles, respectively. This must have something to do with the error, because upon Web Content submission, I log in as two different users which have the two, related, review roles, respectivley, and only one user can see the submission when choosing the "My Workflow Tasks" (i.e. I assume the error abnormally ends the assignment procedure).

Finally, there is a tracked issue, here, which might be related although the reported stack trace is not exactly the same as mine - the root cause, however, might be the same.

Can anyone help me on resolving where this error might originate from?

Thank you all in advance

(EDIT: one might notice I have used 'im' notification-type. Setting it to 'email' did not change anything)
(EDIT2: Removing the fork and join and leaving just one review -just like the single approver- made the workflow to work without errors, so it looks like it has to do with fork, after all...)
(EDIT3: Strangely enough after trying the same Workflow definition on a LR 6.1 CE GA2 installtion, connected to a MySQL db, the Workflow worked without any problem... Now it's even harder to decide where does the problem come from... Plz Help!)
Attachments: content-view-approval.xml (3.7k), submit.txt (13.8k)