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

Oracle, Hibernate Map collections that store empty strings can cause a ConstraintViolationException

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 12.0, 19.0
    • Fix Version/s: 12.0, 19.0
    • Component/s: Assignments
    • Labels:
      None
    • 12 status:
      Resolved
    • Test Plan:
      Hide
      1. Go to a site that has a list of assignments or If there are no assignments, add one.
      2. Click "Edit" on an assignment to modify its configuration.
      3. Make a minor change in the configuration of the assignment and click "Post".

      Expected result, would be to return you to list page after edit. If it fails it will stay in the edit page.

      Additionally, you can check the log file, catalina.out, for the stack trace listed in the description. There should not be an entry in the log.

       

      Show
      Go to a site that has a list of assignments or If there are no assignments, add one. Click "Edit" on an assignment to modify its configuration. Make a minor change in the configuration of the assignment and click "Post". Expected result, would be to return you to list page after edit. If it fails it will stay in the edit page. Additionally, you can check the log file, catalina.out, for the stack trace listed in the description. There should not be an entry in the log.  

      Description

      Testing in our migrated database we experienced this error reviewing assignments migrated from the database.
       

      22-feb-2018 13:16:41.047 ERROR [ajp-nio-8016-exec-10] org.sakaiproject.assignment.tool.AssignmentAction.setNewAssignmentParameters 
      22-feb-2018 13:16:41.062 DEBUG [ajp-nio-8016-exec-10] umu.sakai.login.event.UmuLoginEvent.update Evento: asn.revise.assignment::/assignment/a/2392_G_2017_N_N/3f55885b-b641-48bb-b3bf-f268fc46e993
      22-feb-2018 13:16:41.080 WARN [ajp-nio-8016-exec-10] org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch Exception calling method doAssignment_form java.lang.reflect.InvocationTargetException (Caused by org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [org.sakaiproject.assignment.api.model.Assignment#3f55885b-b641-48bb-b3bf-f268fc46e993])
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.GeneratedMethodAccessor927.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch(VelocityPortletPaneledAction.java:740)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.processAction(VelocityPortletPaneledAction.java:552)
      	at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:228)
      	at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1152)
      	at org.sakaiproject.cheftool.ToolServlet.doPost(ToolServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
      	at org.sakaiproject.vm.ComponentServlet.service(ComponentServlet.java:56)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      	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:413)
      	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:728)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:356)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:513)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1488)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1227)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1061)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:490)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:266)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:154)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1172)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      	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:462)
      	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:52)
      	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:198)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      	at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
      	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)
      Caused by: org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [org.sakaiproject.assignment.api.model.Assignment#3f55885b-b641-48bb-b3bf-f268fc46e993]
      	at org.hibernate.engine.internal.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:618)
      	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:301)
      	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:244)
      	at org.hibernate.event.internal.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:55)
      	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
      	at org.hibernate.internal.SessionImpl.fireUpdate(SessionImpl.java:739)
      	at org.hibernate.internal.SessionImpl.update(SessionImpl.java:731)
      	at org.hibernate.internal.SessionImpl.update(SessionImpl.java:726)
      	at org.sakaiproject.hibernate.HibernateCrudRepository.update(HibernateCrudRepository.java:160)
      	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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      	at com.sun.proxy.$Proxy248.update(Unknown Source)
      	at org.sakaiproject.assignment.impl.AssignmentServiceImpl.updateAssignment(AssignmentServiceImpl.java:1070)
      	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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      	at com.sun.proxy.$Proxy251.updateAssignment(Unknown Source)
      	at org.sakaiproject.assignment.tool.AssignmentAction.commitAssignment(AssignmentAction.java:8652)
      	at org.sakaiproject.assignment.tool.AssignmentAction.post_save_assignment(AssignmentAction.java:7700)
      	at org.sakaiproject.assignment.tool.AssignmentAction.doPost_assignment(AssignmentAction.java:7345)
      	at org.sakaiproject.assignment.tool.AssignmentAction.doAssignment_form(AssignmentAction.java:9980)
      	... 57 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  manuelal@um.es manuel almansa leandrez
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code