Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-533

When flushing transaction, allow for fact that flushing might cause additional persistence commands to be created, and iterate.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: core-1.2.0
    • Fix Version/s: core-1.3.0
    • Component/s: Core
    • Labels:
      None

      Description

      Against 1.3.0-SNAPSHOT, https://github.com/apache/isis/tree/655b6c0b73f38ea8983471ea7d304b944bb9d223,

      had the following stacktrace below.

      ~~~~
      Analysis:

      In org.apache.isis.core.runtime.system.transaction.IsisTransaction#doFlush, we execute all queued persistence commands - these are typically gonna be inserts - via getContainer.persist(...) - or deletes - via getContainer().remove(...). Looking at the code it seems that a call to a collection.addTo or collection.removeFrom also queues up an "update" command.

      Anyway, if in the course of executing one of these commands in the doFlush it cascades such that another persistence command is created, then we'll get this issue. This could legitimately happen if one of the persistence callbacks, such as "saved()" or "deleted()" is used.

      There was a recent issue like this on Isis' .NET "sister" framework, Naked Objects .NET. The solution was to keep flushing until there are no commands left.

      ~~~~~

      • java.util.ConcurrentModificationException
        -
        -
        java.util.AbstractList$Itr#checkForComodification(AbstractList.java:372)
      • java.util.AbstractList$Itr#next(AbstractList.java:343)
        -
        java.util.Collections$UnmodifiableCollection$1#next(Collections.java:1008)
        -
        org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore#executeCommands(DataNucleusObjectStore.java:360)
        -
        org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore#execute(DataNucleusObjectStore.java:355)
        -
        org.apache.isis.core.runtime.system.transaction.IsisTransaction#doFlush(IsisTransaction.java:365)
        -
        org.apache.isis.core.runtime.system.transaction.IsisTransaction#flush(IsisTransaction.java:331)
        -
        org.apache.isis.core.runtime.system.transaction.IsisTransactionManager#flushTransaction(IsisTransactionManager.java:298)
        -
        org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#executeActionOnTargetAndProcessResults(ActionPanel.java:181)
        -
        org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#executeActionAndProcessResults(ActionPanel.java:137)
        -
        org.apache.isis.viewer.wicket.ui.components.actions.ActionParametersFormPanel$ActionParameterForm$1#onSubmit(ActionParametersFormPanel.java:126)
      • org.apache.wicket.markup.html.form.Form#delegateSubmit(Form.java:1253)
      • org.apache.wicket.markup.html.form.Form#process(Form.java:925)
      • org.apache.wicket.markup.html.form.Form#onFormSubmitted(Form.java:771)
      • org.apache.wicket.markup.html.form.Form#onFormSubmitted(Form.java:704)
        -
        sun.reflect.NativeMethodAccessorImpl#invoke0(NativeMethodAccessorImpl.java:-2)
        -
        sun.reflect.NativeMethodAccessorImpl#invoke(NativeMethodAccessorImpl.java:39)
        -
        sun.reflect.DelegatingMethodAccessorImpl#invoke(DelegatingMethodAccessorImpl.java:25)
      • java.lang.reflect.Method#invoke(Method.java:597)
        -
        org.apache.wicket.RequestListenerInterface#internalInvoke(RequestListenerInterface.java:258)
        -
        org.apache.wicket.RequestListenerInterface#invoke(RequestListenerInterface.java:216)
        -
        org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#invokeListener(ListenerInterfaceRequestHandler.java:240)
        -
        org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#respond(ListenerInterfaceRequestHandler.java:226)
        -
        org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor#respond(RequestCycle.java:861)
        -
        org.apache.wicket.request.RequestHandlerStack#execute(RequestHandlerStack.java:64)
        -
        org.apache.wicket.request.cycle.RequestCycle#execute(RequestCycle.java:261)
        -
        org.apache.wicket.request.cycle.RequestCycle#processRequest(RequestCycle.java:218)
        -
        org.apache.wicket.request.cycle.RequestCycle#processRequestAndDetach(RequestCycle.java:289)
        -
        org.apache.wicket.protocol.http.WicketFilter#processRequestCycle(WicketFilter.java:259)
        -
        org.apache.wicket.protocol.http.WicketFilter#processRequest(WicketFilter.java:201)
        -
        org.apache.wicket.protocol.http.WicketFilter#doFilter(WicketFilter.java:282)
        -
        org.eclipse.jetty.servlet.ServletHandler$CachedChain#doFilter(ServletHandler.java:1326)
        -
        org.apache.shiro.web.servlet.AbstractShiroFilter#executeChain(AbstractShiroFilter.java:449)
        -
        org.apache.shiro.web.servlet.AbstractShiroFilter$1#call(AbstractShiroFilter.java:365)
        -
        org.apache.shiro.subject.support.SubjectCallable#doCall(SubjectCallable.java:90)
        -
        org.apache.shiro.subject.support.SubjectCallable#call(SubjectCallable.java:83)
        -
        org.apache.shiro.subject.support.DelegatingSubject#execute(DelegatingSubject.java:383)
        -
        org.apache.shiro.web.servlet.AbstractShiroFilter#doFilterInternal(AbstractShiroFilter.java:362)
        -
        org.apache.shiro.web.servlet.OncePerRequestFilter#doFilter(OncePerRequestFilter.java:125)
        -
        org.eclipse.jetty.servlet.ServletHandler$CachedChain#doFilter(ServletHandler.java:1326)
        -
        org.eclipse.jetty.servlet.ServletHandler#doHandle(ServletHandler.java:479)
        -
        org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:119)
        -
        org.eclipse.jetty.security.SecurityHandler#handle(SecurityHandler.java:520)
        -
        org.eclipse.jetty.server.session.SessionHandler#doHandle(SessionHandler.java:227)
        -
        org.eclipse.jetty.server.handler.ContextHandler#doHandle(ContextHandler.java:940)
        -
        org.eclipse.jetty.servlet.ServletHandler#doScope(ServletHandler.java:409)
        -
        org.eclipse.jetty.server.session.SessionHandler#doScope(SessionHandler.java:186)
        -
        org.eclipse.jetty.server.handler.ContextHandler#doScope(ContextHandler.java:874)
        -
        org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:117)
        -
        org.eclipse.jetty.server.handler.ContextHandlerCollection#handle(ContextHandlerCollection.java:250)
        -
        org.eclipse.jetty.server.handler.HandlerCollection#handle(HandlerCollection.java:149)
        -
        org.eclipse.jetty.server.handler.HandlerWrapper#handle(HandlerWrapper.java:110)
      • org.eclipse.jetty.server.Server#handle(Server.java:349)
        -
        org.eclipse.jetty.server.HttpConnection#handleRequest(HttpConnection.java:441)
        -
        org.eclipse.jetty.server.HttpConnection$RequestHandler#content(HttpConnection.java:921)
      • org.eclipse.jetty.http.HttpParser#parseNext(HttpParser.java:784)
      • org.eclipse.jetty.http.HttpParser#parseAvailable(HttpParser.java:223)
        -
        org.eclipse.jetty.server.AsyncHttpConnection#handle(AsyncHttpConnection.java:46)
        -
        org.eclipse.jetty.io.nio.SelectChannelEndPoint#handle(SelectChannelEndPoint.java:545)
        -
        org.eclipse.jetty.io.nio.SelectChannelEndPoint$1#run(SelectChannelEndPoint.java:43)
        -
        org.eclipse.jetty.util.thread.QueuedThreadPool#runJob(QueuedThreadPool.java:598)
        -
        org.eclipse.jetty.util.thread.QueuedThreadPool$3#run(QueuedThreadPool.java:533)
      • java.lang.Thread#run(Thread.java:680)

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Dan Haywood
              Reporter:
              danhaywood Dan Haywood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: