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

StaleObjectStateException on concurrent login

    Details

    • Fix Priority:
      5

      Description

      Basic issue: upon attempting concurrent login with the same user credentials, this exception is sometimes encountered:

      21:35:06,219 ERROR [ajp-apr-8010-exec-5][MainServlet:531] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=4548, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=Tue Apr 02 07:03:32 GMT 2013, modifiedDate=Wed Apr 12 21:35:06 GMT 2017, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=Wed Jun 08 02:01:22 GMT 2016, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=Wed Apr 12 21:35:06 GMT 2017, loginIP=172.16.20.68, lastLoginDate=Wed Apr 12 21:35:05 GMT 2017, lastLoginIP=172.16.20.68, lastFailedLoginDate=Mon Apr 10 18:47:52 GMT 2017, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0} is stale in comparison to {mvccVersion=4549, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=2013-04-02 07:03:32.0, modifiedDate=2017-04-12 21:35:06.14, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=2016-06-08 02:01:22.0, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=2017-04-12 21:35:06.139, loginIP=172.16.20.68, lastLoginDate=2017-04-12 21:35:05.067, lastLoginIP=172.16.20.68, lastFailedLoginDate=2017-04-10 18:47:52.297, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0}
      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=4548, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=Tue Apr 02 07:03:32 GMT 2013, modifiedDate=Wed Apr 12 21:35:06 GMT 2017, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=Wed Jun 08 02:01:22 GMT 2016, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=Wed Apr 12 21:35:06 GMT 2017, loginIP=172.16.20.68, lastLoginDate=Wed Apr 12 21:35:05 GMT 2017, lastLoginIP=172.16.20.68, lastFailedLoginDate=Mon Apr 10 18:47:52 GMT 2017, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0} is stale in comparison to {mvccVersion=4549, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=2013-04-02 07:03:32.0, modifiedDate=2017-04-12 21:35:06.14, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=2016-06-08 02:01:22.0, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=2017-04-12 21:35:06.139, loginIP=172.16.20.68, lastLoginDate=2017-04-12 21:35:05.067, lastLoginIP=172.16.20.68, lastFailedLoginDate=2017-04-10 18:47:52.297, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0}
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:264)
      	at com.liferay.portal.service.persistence.impl.UserPersistenceImpl.updateImpl(UserPersistenceImpl.java:7849)
      	at com.liferay.portal.service.persistence.impl.UserPersistenceImpl.updateImpl(UserPersistenceImpl.java:84)
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:347)
      	at com.liferay.portal.service.impl.UserLocalServiceImpl.resetFailedLoginAttempts(UserLocalServiceImpl.java:6284)
      	at com.liferay.portal.service.impl.UserLocalServiceImpl.updateLastLogin(UserLocalServiceImpl.java:4667)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy76.updateLastLogin(Unknown Source)
      	at com.liferay.portal.kernel.service.UserLocalServiceUtil.updateLastLogin(UserLocalServiceUtil.java:963)
      	at com.liferay.portal.servlet.MainServlet.loginUser(MainServlet.java:1065)
      	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:523)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:102)
      	at com.liferay.osb.testray.dashboard.web.internal.servlet.filter.TestrayURLAliasFilter.processFilter(TestrayURLAliasFilter.java:65)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:337)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:181)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:466)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
      	at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:169)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.testray.hook.filter.TestrayJSONAPIFilter.processFilter(TestrayJSONAPIFilter.java:78)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:102)
      	at com.liferay.osb.testray.dashboard.web.internal.servlet.filter.TestrayURLAliasFilter.processFilter(TestrayURLAliasFilter.java:65)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:336)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:125)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:337)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:358)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:270)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:257)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:181)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
      	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
      	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
      	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
      	at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      	at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:868)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: {mvccVersion=4548, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=Tue Apr 02 07:03:32 GMT 2013, modifiedDate=Wed Apr 12 21:35:06 GMT 2017, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=Wed Jun 08 02:01:22 GMT 2016, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=Wed Apr 12 21:35:06 GMT 2017, loginIP=172.16.20.68, lastLoginDate=Wed Apr 12 21:35:05 GMT 2017, lastLoginIP=172.16.20.68, lastFailedLoginDate=Mon Apr 10 18:47:52 GMT 2017, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0} is stale in comparison to {mvccVersion=4549, uuid=5b0e7962-b09c-40b6-99b3-75061a98ac7a, userId=10196, companyId=10154, createDate=2013-04-02 07:03:32.0, modifiedDate=2017-04-12 21:35:06.14, defaultUser=false, contactId=10197, password={PBKDF2WITHHMACSHA1}AAAAoAAB9AADFBAjcPWmr0bcO6YuNId3hZJZ9oljYUVT+NBQ, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=2016-06-08 02:01:22.0, digest=354d7cc794b1a140fa180a4d2509ad95,da0ac143160ff0783d375938a17a5741,6492ce578a8d0b5d4b9361de19568bca, reminderQueryQuestion=what-is-your-father's-middle-name, reminderQueryAnswer=test, graceLoginCount=0, screenName=test, emailAddress=test@liferay.com, facebookId=0, googleUserId=, ldapServerId=-1, openId=, portraitId=0, languageId=en_US, timeZoneId=America/Los_Angeles, greeting=Welcome Test Test!, comments=, firstName=Test, middleName=, lastName=Test, jobTitle=, loginDate=2017-04-12 21:35:06.139, loginIP=172.16.20.68, lastLoginDate=2017-04-12 21:35:05.067, lastLoginIP=172.16.20.68, lastFailedLoginDate=2017-04-10 18:47:52.297, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=true, emailAddressVerified=true, status=0}
      	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.UserPersistenceImpl.updateImpl(UserPersistenceImpl.java:7845)
      	... 164 more
      Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.UserImpl#10196]
      	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)
      	... 166 more
      

      We're seeing this issue while running automated API tests in multiple threads, all using Basic Authentication (and thus logging in separately for each request). There are obviously ways around encountering the issue in this way (e.g. single-threading the tests, using different users for each thread, using different instances for each thread, etc.); however, we foresee this becoming an issue in production as well. We're creating a system that will integrate with several other systems through APIs, and these API calls will all need to execute a login concurrently, ideally as a single user.

      Looking more into the exception listed above, I've diff'd the "before" and "after" snapshots that are given as ORMException: [x] is stale in comparison to [y]. I think the difference is all in the mvccVersion (which, I assume, should be incremented with every update), modifiedDate, loginDate, and lastLoginDate fields (some lines don't show any difference, but the diff is probably just less than I second and therefore not seen).

      IMHO, I'm not so sure loginDate and lastLoginDate have a place as fields on a table meant to support multi-threaded behavior. It seems to me that at least lastLoginDate presumes a knowledge of the state of other threads – is this not inherently opposed to thread safety?

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                18 weeks, 5 days ago

                Packages

                Version Package