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

Forums: StaleObjectStateException error occurs when editing the group permissions in forum settings

    XMLWordPrintable

    Details

    • 21 Status:
      Resolved
    • Test Plan:
      Hide
      1. As an instructor, create a new forum in a course site that has at least 2 groups. 
      2. Create a topic in the new forum. Keep the forum setting and the topic setting as default.
      3. Click forum setting and change the permission of students to be "none" and group 1 to be "contributor" and click "save."

      (x)Expected Behavior: The setting is modified correctly.

      (/)Current Behavior: An unexpected error occurs. (See the screenshot)

      *The error might not occur at first. Try to edit the forum setting for multiple times.

       

      Show
      As an instructor, create a new forum in a course site that has at least 2 groups.  Create a topic in the new forum. Keep the forum setting and the topic setting as default. Click forum setting and change the permission of students to be "none" and group 1 to be "contributor" and click "save." (x)Expected Behavior : The setting is modified correctly. (/)Current Behavior: An unexpected error occurs. (See the screenshot) *The error might not occur at first. Try to edit the forum setting for multiple times.  

      Description

      When editing the group permission of a published forum, sometimes an unexpected error might occur. (See the screenshot)This error message is shown below:

      org.sakaiproject.portal.api.PortalHandlerException: org.sakaiproject.tool.api.ToolException: javax.servlet.ServletException: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl] with identifier [15]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
      caused by: org.sakaiproject.tool.api.ToolException: javax.servlet.ServletException: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl] with identifier [15]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1502)
      caused by: javax.servlet.ServletException: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl] with identifier [15]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      caused by: javax.faces.el.EvaluationException: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl] with identifier [15]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      caused by: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl] with identifier [15]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:392)
      caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [org.sakaiproject.component.app.messageforums.dao.hibernate.DiscussionForumImpl#15]
          at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:356)
          at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:188)
          at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:927)
          at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:897)
          at org.hibernate.engine.spi.CascadingActions$6.cascade(CascadingActions.java:261)
          at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:490)
          at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:415)
          at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:216)
          at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:149)
          at org.hibernate.event.internal.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:428)
          at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:256)
          at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:334)
          at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:188)
          at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:72)
          at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:905)
          at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:891)
          at org.springframework.orm.hibernate5.HibernateTemplate.lambda$merge$21(HibernateTemplate.java:751)
          at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:385)
          at org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:351)
          at org.springframework.orm.hibernate5.HibernateTemplate.merge(HibernateTemplate.java:749)
          at org.sakaiproject.component.app.messageforums.PermissionLevelManagerImpl.deleteMembershipItems(PermissionLevelManagerImpl.java:750)
          at sun.reflect.GeneratedMethodAccessor6931.invoke(null:-1)
          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.$Proxy166.deleteMembershipItems(null:-1)
          at org.sakaiproject.tool.messageforums.DiscussionForumTool.setObjectPermissions(DiscussionForumTool.java:6680)
          at org.sakaiproject.tool.messageforums.DiscussionForumTool.saveForumSettings(DiscussionForumTool.java:1451)
          at org.sakaiproject.tool.messageforums.DiscussionForumTool.processForumSettings(DiscussionForumTool.java:1405)
          at org.sakaiproject.tool.messageforums.DiscussionForumTool.processActionSaveForumSettings(DiscussionForumTool.java:1343)
          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 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:231)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:447)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
          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:231)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:447)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
          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:1502)
          at org.sakaiproject.portal.charon.handlers.ToolHandler.doTool(ToolHandler.java:200)
          at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:96)
          at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
          at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1175)
          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:231)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:496)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
          at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:748)
      user: c5ce2b91-1cde-48bd-b9d8-80a989f900c6usage-session: ea42dba4-28eb-4882-be92-8417896bbc7atime: Oct 10, 2020 7:53:04 PM EDT
      

      This issue only occurs on 21.x nightly server, but not 22.x trunk server. It might be related to the fix to SAK-44301.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  ottenhoff Sam Ottenhoff
                  Reporter:
                  fyin2 Fangcong Yin
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration