Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-45832

Multiple simultaneous edits causes StaleObjectStateException during editing a post/reply

    XMLWordPrintable

Details

    • Bug
    • Status: RESOLVED
    • Major
    • Resolution: Fixed
    • 21.2 [Tentative], 22.0 [Tentative]
    • 22.0 [Tentative]
    • Forums Tool
    • None
    • Please Merge
    • Hide
      1. Create a Forum and a Topic
      2. Open 2 different sessions that can create a post (i.e. same user 2 different browsers)
      3. tail the catalina.out log (as the exception appears here)
      4. Create a conversation
      5. in both sessions view the newly created conversation
      6. in both sessions edit the conversation
      7. enter different information into the text area for both sessions
      8. press save in both sessions
      9. which ever session you choose to save first will be fine, the second sessions will receive the stack trace in the log and lose their information
      10. the second user receives no information that an error has occurred
      Show
      Create a Forum and a Topic Open 2 different sessions that can create a post (i.e. same user 2 different browsers) tail the catalina.out log (as the exception appears here) Create a conversation in both sessions view the newly created conversation in both sessions edit the conversation enter different information into the text area for both sessions press save in both sessions which ever session you choose to save first will be fine, the second sessions will receive the stack trace in the log and lose their information the second user receives no information that an error has occurred

    Description

      When a user or users attempt to edit the same post/reply they can cause the following exception:

      This can happen more frequently when a user is working on editing a post or reply for long periods of time.

      15-Jul-2021 02:44:57.956 ERROR [http-apr-8123-exec-159] org.sakaiproject.tool.messageforums.DiscussionForumTool.processDfMsgRevisedPost DiscussionForumTool: processDfMsgRevisedPost javax.persistence.OptimisticLockException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.MessageImpl#1260244] at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:226) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:93) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:917) at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:891) at org.sakaiproject.component.app.messageforums.MessageForumsMessageManagerImpl.saveOrUpdateMessage(MessageForumsMessageManagerImpl.java:1310) at org.sakaiproject.component.app.messageforums.MessageForumsMessageManagerImpl.saveOrUpdateMessage(MessageForumsMessageManagerImpl.java:1276) at sun.reflect.GeneratedMethodAccessor3286.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy212.saveOrUpdateMessage(Unknown Source) at org.sakaiproject.component.app.messageforums.ui.DiscussionForumManagerImpl.saveMessage(DiscussionForumManagerImpl.java:480) at org.sakaiproject.component.app.messageforums.ui.DiscussionForumManagerImpl.saveMessage(DiscussionForumManagerImpl.java:457) at sun.reflect.GeneratedMethodAccessor3285.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:367) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy216.saveMessage(Unknown Source) at org.sakaiproject.tool.messageforums.DiscussionForumTool.processDfMsgRevisedPost(DiscussionForumTool.java:4604) at sun.reflect.GeneratedMethodAccessor5748.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.el.parser.AstValue.invoke(AstValue.java:247) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267) at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:74) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) at javax.faces.component.UICommand.broadcast(UICommand.java:330) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:870) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1418) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:447) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.sakaiproject.tool.messageforums.MessageForumsFilePickerServlet.dispatch(MessageForumsFilePickerServlet.java:171) at org.sakaiproject.jsf2.util.JsfTool.doPost(JsfTool.java:250) at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:447) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:508) at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1501) at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1222) at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1056) at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:499) at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:275) at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:163) at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69) at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1173) at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:496) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
      

      Gliffy Diagrams

        Zeplin

          Attachments

            Issue Links

              Activity

                People

                  ern Earle R Nietzel
                  ern Earle R Nietzel
                  Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                    Created:
                    Updated:
                    Resolved:

                    Git Integration