0 Replies Latest reply on Dec 23, 2008 9:34 AM by Vinay Kumar

    Could not load an entity due to deadlock

    Vinay Kumar Newbie

      I'm getting the following exception when running my application accessing SLSB with multiple clients. I'm using JBoss 4.2.2.GA, Remoting 2.4.0.SP1 & PostgreSQL 8.3.

      Please suggest the required changes.

      <log4j:event logger="org.hibernate.util.JDBCExceptionReporter" timestamp="1230031498630" level="ERROR" thread="WorkerThread#89[150.158.72.145:3325]">
      <log4j:message><![CDATA[ERROR: deadlock detected
      Detail: Process 6876 waits for AccessShareLock on relation 105628 of database 16403; blocked by process 5512.
      Process 5512 waits for AccessExclusiveLock on relation 105646 of database 16403; blocked by process 6876.]]></log4j:message>
      </log4j:event>

      <log4j:event logger="org.hibernate.event.def.DefaultLoadEventListener" timestamp="1230031498645" level="INFO" thread="WorkerThread#89[150.158.72.145:3325]">
      <log4j:message><![CDATA[Error performing load command]]></log4j:message>
      <log4j:throwable><![CDATA[org.hibernate.exception.GenericJDBCException: could not load an entity: [com.barco.cms.service.perspectivemgt.SquidModeConfiguration#561]
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1874)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
      at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
      at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
      at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
      at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
      at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
      at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
      at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557)
      at org.hibernate.type.EntityType.resolve(EntityType.java:379)
      at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
      at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
      at org.hibernate.loader.Loader.doQuery(Loader.java:729)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      at org.hibernate.loader.Loader.doList(Loader.java:2220)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      at org.hibernate.loader.Loader.list(Loader.java:2099)
      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
      at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
      at com.barco.cms.openapi.PerspectiveMgtAPIImpl.lookupDisplays(Unknown Source)
      at com.barco.cms.openapi.PerspectiveMgtAPIImpl.getDisplaysInfo(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at com.barco.cms.openapi.PerspectiveMgtAPIImpl.initialSteps(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:146)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
      Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
      Detail: Process 6876 waits for AccessShareLock on relation 105628 of database 16403; blocked by process 5512.
      Process 5512 waits for AccessExclusiveLock on relation 105646 of database 16403; blocked by process 6876.
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
      at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:90)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
      at org.hibernate.loader.Loader.doQuery(Loader.java:674)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
      ... 65 more
      ]]></log4j:throwable>
      </log4j:event>