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

Occasional StaleStateExceptions during CI testing

    Details

    • Fix Priority:
      3

      Description

      Occasional StaleStateExceptions during CI testing. Issue occurs when a preference is updated without clearing the PortalPreferencesWrapperCacheUtil. See stack trace below:

      java.io.IOException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=0, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>company.security.send.password.reset.link</name><value>true</value></preference><preference><name>company.security.send.password</name><value>false</value></preference></portlet-preferences>} is stale in comparison to {mvccVersion=1, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>ldap.server.ids</name><value></value></preference></portlet-preferences>}
      	at com.liferay.portlet.PortalPreferencesImpl.store(PortalPreferencesImpl.java:373)
      	at com.liferay.portlet.PortalPreferencesWrapper.store(PortalPreferencesWrapper.java:91)
      	at com.liferay.portal.service.UserServiceTest$WhenPortalSendsPasswordEmail.givenThatCompanySendsResetPasswordLink(UserServiceTest.java:920)
      	at com.liferay.portal.service.UserServiceTest$WhenPortalSendsPasswordEmail.shouldSendResetLinkEmailByUserId(UserServiceTest.java:868)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.test.rule.LiferayIntegrationTestRule$1$1.evaluate(LiferayIntegrationTestRule.java:140)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.test.rule.LiferayIntegrationTestRule$1$1.evaluate(LiferayIntegrationTestRule.java:140)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      	at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=0, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>company.security.send.password.reset.link</name><value>true</value></preference><preference><name>company.security.send.password</name><value>false</value></preference></portlet-preferences>} is stale in comparison to {mvccVersion=1, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>ldap.server.ids</name><value></value></preference></portlet-preferences>}
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:267)
      	at com.liferay.portal.service.persistence.impl.PortalPreferencesPersistenceImpl.updateImpl(PortalPreferencesPersistenceImpl.java:584)
      	at com.liferay.portal.service.persistence.impl.PortalPreferencesPersistenceImpl.updateImpl(PortalPreferencesPersistenceImpl.java:63)
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:348)
      	at com.liferay.portal.service.base.PortalPreferencesLocalServiceBaseImpl.updatePortalPreferences(PortalPreferencesLocalServiceBaseImpl.java:313)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:85)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
      	at com.sun.proxy.$Proxy233.updatePortalPreferences(Unknown Source)
      	at com.liferay.portal.kernel.service.PortalPreferencesLocalServiceUtil.updatePortalPreferences(PortalPreferencesLocalServiceUtil.java:148)
      	at com.liferay.portlet.PortalPreferencesImpl.store(PortalPreferencesImpl.java:366)
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=0, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>company.security.send.password.reset.link</name><value>true</value></preference><preference><name>company.security.send.password</name><value>false</value></preference></portlet-preferences>} is stale in comparison to {mvccVersion=1, portalPreferencesId=20117, ownerId=20116, ownerType=1, preferences=<portlet-preferences><preference><name>ldap.server.ids</name><value></value></preference></portlet-preferences>}
      	at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:46)
      	at com.liferay.portal.dao.orm.hibernate.SessionImpl.merge(SessionImpl.java:244)
      	at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.merge(ClassLoaderSession.java:410)
      	at com.liferay.portal.service.persistence.impl.PortalPreferencesPersistenceImpl.updateImpl(PortalPreferencesPersistenceImpl.java:580)
      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.PortalPreferencesImpl#20117]
      	at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)
      	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
      	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
      	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
      	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
      	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
      	at com.liferay.portal.dao.orm.hibernate.SessionImpl.merge(SessionImpl.java:241)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                preston.crary Preston Crary
                Reporter:
                preston.crary Preston Crary
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 2 weeks, 3 days ago

                  Packages

                  Version Package
                  7.0.X EE
                  Master