Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-25518

DLFileRank related exception when accessing Document Library

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 6.0.12 EE, 6.1.0 CE GA1, 6.2.0 CE M2
    • Component/s: Documents & Media
    • Labels:
      None
    • Environment:
      LIFERAY VERSION: 6.0 SP 1
      OPERATING SYSTEM: Linux
      APPLICATION SERVER: Tomcat 6.x
      JAVA VIRTUAL MACHINE: Java 6
      DATABASE: MySQL 5.1

      Description

      A "org.hibernate.StaleStateException: Batch update returned unexpected row" exception may occur when accessing documents in the Document Library. If multiple threads or multiple cluster attempts to update the same DLFileRank, the following exception will occur:

      DLFileRankLocalServiceImpl.java
      15:48:26,772 INFO  [PortalImpl:3948] Current URL /documents/10157/ef06bc69-0b73-4dce-a4ed-ba7937cf0cfa generates exception: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      15:48:26,774 WARN  [PortalImpl:3971] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      	at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:190)
      	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.updateImpl(DLFileRankPersistenceImpl.java:319)
      	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.updateImpl(DLFileRankPersistenceImpl.java:1)
      	at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:254)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileRankLocalServiceImpl.updateFileRank(DLFileRankLocalServiceImpl.java:147)
      	at sun.reflect.GeneratedMethodAccessor610.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:86)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy149.updateFileRank(Unknown Source)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.getFileAsStream(DLFileEntryLocalServiceImpl.java:509)
      	at sun.reflect.GeneratedMethodAccessor609.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:86)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at $Proxy147.getFileAsStream(Unknown Source)
      	at com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil.getFileAsStream(DLFileEntryLocalServiceUtil.java:400)
      	at com.liferay.portal.webserver.WebServerServlet.sendFile(WebServerServlet.java:331)
      	at com.liferay.portal.webserver.WebServerServlet.service(WebServerServlet.java:160)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:239)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:81)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:181)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:208)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.servlet.filters.absoluteredirects.AbsoluteRedirectsFilter.processFilter(AbsoluteRedirectsFilter.java:85)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:52)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      	at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
      	at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:118)
      	at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.flush(ClassLoaderSession.java:176)
      	at com.liferay.portal.service.persistence.BatchSessionImpl.update(BatchSessionImpl.java:95)
      	at com.liferay.portal.service.persistence.BatchSessionUtil.update(BatchSessionUtil.java:49)
      	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.updateImpl(DLFileRankPersistenceImpl.java:314)
      	... 104 more
      Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
      	at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
      	at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
      	at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
      	at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
      	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
      	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
      	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
      	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      	at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:115)
      	... 108 more
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jang.kim Jang Kim (Inactive)
              Reporter:
              joshua.kuo Joshua Kuo (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 24 weeks, 1 day ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2