AnsweredAssumed Answered

Hibernate lock wait timeout exceeded

Question asked by hbf on Jan 10, 2008
Latest reply on Jan 24, 2008 by jharrop
Hi,

We have problem programmatically creating a new child node. Sometimes this exception occurs:


Exception: JException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
org.apache.hivemind.ApplicationRuntimeException
JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
component: $CasePage_60@3c1[CasePage]
location: context:/WEB-INF/CasePage.page, line 4, column 83
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE page-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.1//EN"
3 "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_1.dtd">
4 <page-specification class="org.myorg.tapestry.myapp.pages.CasePage">
5 <property name="nodeRef" persist="client" initial-value="ognl:null"/>
6 </page-specification>

[ +/- ] Exception: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
org.springframework.orm.hibernate3.HibernateJdbcException
JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]

[ +/- ] Exception: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
org.hibernate.exception.GenericJDBCException
could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
SQL: update alf_node set version=?, protocol=?, identifier=?, uuid=?, type_qname=?, acl_id=? where id=? and version=?
SQLState: 41000
errorCode: 1205
messages:

* could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
* Lock wait timeout exceeded; try restarting transaction

throwableCount: 2
throwables:

* org.hibernate.exception.GenericJDBCException: could not update: [org.alfresco.repo.domain.hibernate.NodeImpl#28232]
* java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction


[ +/- ] Exception: Lock wait timeout exceeded; try restarting transaction
java.sql.SQLException
Lock wait timeout exceeded; try restarting transaction
SQLState: 41000
errorCode: 1205
Stack Trace:

* com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
* com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
* com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
* com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1160)
* com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:685)
* com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1400)
* com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1314)
* com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1299)
* org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
* org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2357)
* org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2257)
* org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2557)
* org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)
* org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
* org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
* org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
* org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
* org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:41)
* org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
* org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
* org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
* org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl$7.doInHibernate(HibernateNodeDaoServiceImpl.java:852)
* org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
* org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
* org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl.getChildAssocRefs(HibernateNodeDaoServiceImpl.java:855)
* sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
* org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
* org.alfresco.repo.transaction.TransactionalDaoInterceptor.invoke(TransactionalDaoInterceptor.java:68)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
* $Proxy1.getChildAssocRefs(Unknown Source)
* org.alfresco.repo.node.db.DbNodeServiceImpl.getChildAssocs(DbNodeServiceImpl.java:1287)
* sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
* org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
* org.alfresco.repo.transaction.TransactionResourceInterceptor.invoke(TransactionResourceInterceptor.java:138)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
* $Proxy3.getChildAssocs(Unknown Source)
* sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
* $Proxy4.getChildAssocs(Unknown Source)
* sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
* org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
* org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:241)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:241)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:261)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:261)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
* $Proxy3.getChildAssocs(Unknown Source)
* sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
* sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
* java.lang.reflect.Method.invoke(Method.java:585)
* org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
* org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
* net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:241)
* org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
* org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
* org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
* $Proxy3.getChildAssocs(Unknown Source)

Any idea what could be the cause of this?

I understand it's a concurrency issue, but that's about it.

Thanks,
Kaspar

Outcomes