Entity id should be not zero

1
Hi, I have simple page with one button, which opens new page using microflow (pattern from training video - create new entity and pass it as parameter to open page method). My entity is simple, and has one reference field (with proper association) to another entity. Edit page contains one integer field and one reference data selector. When I click "Cancel" button on newly opened form, application crashes with following error:   An error has occurred while handling the request. [User 'Anonymous_6acbcdd6-a467-4302-b329-28643c042035' with session id '6832bb2b-fda1-4e03-849e-70b74ae6f4a9' and roles 'Administrator'] -------- com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreRuntimeException: Exception occurred in action '{"changes":"{ManagementModule.Style_Subsection=1}","type":"ChangeAction"}', all database changes executed by this action were rolled back at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:178) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreRuntimeException: Exception occurred in action '{"changes":"{ManagementModule.Style_Subsection=1}","type":"ChangeAction"}', all database changes executed by this action were rolled back at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37) Caused by: com.mendix.core.CoreRuntimeException: Exception occurred in action '{"changes":"{ManagementModule.Style_Subsection=1}","type":"ChangeAction"}', all database changes executed by this action were rolled back at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.processErrorState(CoreActionHandlerImpl.scala:152) Caused by: java.lang.IllegalArgumentException: Entity id should be not zero at com.mendix.basis.objectmanagement.SchemeManagerImpl.getObjectType(SchemeManagerImpl.java:1435) at com.mendix.basis.objectmanagement.MendixIdentifier.getObjectType(MendixIdentifier.java:94) at com.mendix.basis.objectmanagement.member.MendixObjectReferenceImpl.setValue(MendixObjectReferenceImpl.scala:34) at com.mendix.basis.objectmanagement.member.MendixObjectReferenceImpl.setValue(MendixObjectReferenceImpl.scala:15) at com.mendix.basis.objectmanagement.MendixObjectMemberImpl.parseValueFromString(MendixObjectMemberImpl.java:248) at com.mendix.basis.action.user.Changer$class.setMemberValue(Changer.scala:61) at com.mendix.basis.action.user.Changer$class.changeMember(Changer.scala:31) at com.mendix.basis.action.user.ChangeAction.changeMember(ChangeAction.scala:13) at com.mendix.basis.action.user.ChangeAction$$anonfun$executeAction$1.apply(ChangeAction.scala:36) at com.mendix.basis.action.user.ChangeAction$$anonfun$executeAction$1.apply(ChangeAction.scala:35) at scala.collection.Iterator$class.foreach(Iterator.scala:893) at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at com.mendix.basis.action.user.ChangeAction.executeAction(ChangeAction.scala:35) at com.mendix.basis.action.user.ChangeAction.executeAction(ChangeAction.scala:13) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.change(InternalCore.java:136) at com.mendix.webui.requesthandling.RequestHandlingUtil$$anonfun$validateChanges$1$$anonfun$3.apply(RequestHandlingUtil.scala:50) at com.mendix.webui.requesthandling.RequestHandlingUtil$$anonfun$validateChanges$1$$anonfun$3.apply(RequestHandlingUtil.scala:37) at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:683) at scala.collection.immutable.Map$Map1.foreach(Map.scala:116) at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:682) at com.mendix.webui.requesthandling.RequestHandlingUtil$$anonfun$validateChanges$1.apply(RequestHandlingUtil.scala:37) at com.mendix.webui.requesthandling.RequestHandlingUtil$$anonfun$validateChanges$1.apply(RequestHandlingUtil.scala:32) at scala.Option.map(Option.scala:146) at com.mendix.webui.requesthandling.RequestHandlingUtil$.validateChanges(RequestHandlingUtil.scala:32) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:300) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:293) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:293) at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.IMonitoredAction$class.monitor(IMonitoredAction.scala:49) at com.mendix.webui.requesthandling.ClientRequestHandler$ClientMonitoredAction.monitor(ClientRequestHandler.scala:408) at com.mendix.webui.requesthandling.ClientRequestHandler.handleRequest(ClientRequestHandler.scala:293) at com.mendix.webui.requesthandling.ClientRequestHandler.handleActionWithSessionRequired(ClientRequestHandler.scala:235) at com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:202) at com.mendix.webui.requesthandling.ClientRequestHandler.liftedTree1$1(ClientRequestHandler.scala:101) at com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:93) at com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:40) at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:70) at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:67) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:73) at com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:885) at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(RuntimeHandler.java:41) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:368) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:745)   Interestingly, the error does not occur if reference data selector has not been changed on the edit page.   P.S. I use Microsoft SQL Server 2008 R2 SP3, error also occured using SQL Server 2014.
asked
2 answers
1

I think this is caused by the application trying to rollback the object to whom a reference is set when clicking cancel. For some reason, this cannot be done. Did you already try to make a custom cancel button with a rollback so you can debug the microflow?

answered
0

 Of course, my root entity is "Style", reference data selector is bind to  "Subsection" entity.

 

answered