Strangely I am not doing any addTo or removeFrom in my code at all. I do queries that return collections and I retrieve individual entities and update them.
Sent from my iPhone On Sep 15, 2013, at 11:40 AM, Dan Haywood <[email protected]> wrote: > Hi James, > Thanks for posting this stack trace; I think you've uncovered an issue > actually. To confirm, it would be useful to see the code that's being > executed, but I let me speculate anyway... > > 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 against the object with the collection. (I suspect this is > redundant if using JDO objectstore, but that's a slightly different topic). > > 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. > > So, I'm going to implement something similar for Isis. I've just created > ISIS-533 [1] to fix. I've also created ISIS-534 [2] to investigate whether > the collection.addTo/removeFrom needs to do anything for JDO (low > priority).. > > Thx > Dan > > [1] https://issues.apache.org/jira/browse/ISIS-533 > [2] https://issues.apache.org/jira/browse/ISIS-534 > > > > On 15 September 2013 08:27, GESCONSULTOR <[email protected]> wrote: > >> Hi james. >> >> Have you used both the JDO annotations and the addToXXX / removeFromXXX >> isis eclipse templates ? >> >> The latter ones should not be used with JDO as DataNucleus automatically >> manages the relationships when doing getContainer().flush(). >> >> More info here [1]. >> >> If that's not the case, can you paste on the mail the code defining the >> relationship? >> >> >> [1] >> http://isis.apache.org/components/objectstores/jdo/managed-1-to-m-relationships.html >> >> >> >> El 14/09/2013, a las 21:16, james agada <[email protected]> escribió: >> >>> - 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) >>> >>> POWERED BY: APACHE ISIS <http://isis.apache.org/> >>
