FileManager fails to load more than one file into System.FileDocument
Hello, I am running Mendix 3.1.1 and I find that when inserting the second or later file into my database using FileManager, the Save command fails. This is apparently because the Save command retrieves the current record from the database by selecting fileid=0. Since after the first insert there will be more than one record with fileid=0 (the fileid field is not self-incrementing) we get multiple records returned and the following error gets thrown: Uploading file failed: File document for file id 0 could not be retrieved [User 'admin' with roles 'Administrator'] com.mendix.systemwideinterfaces.MendixRuntimeException: File document for file id 0 could not be retrieved at iE.b(SourceFile:300) at iE.a(SourceFile:163) at iE.a(SourceFile:105) at iE.a(SourceFile:82) at iE.processRequest(SourceFile:75) at iG.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:842) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Thread.java:662) ack and the save operation fails with: Is there any workaround for this problem? Thanks, Michael
I suggest filing a ticket with test project at support.mendix.com
Thanks for your advice. Just some feedback:
I tried to set up a repro in a new project and could not reproduce the behaviour.
Finally, I tried creating a fresh database from my existing project on another database server and that also didn't have the problem. I then tried dropping and recreating the affected tables in the original database but that also didn't solve the problem.
Eventually I rebuilt a fresh database on my dev server and that solved the problem. Only problem is that I have to now save and restore the existing data for the production db before I deploy, but at least the problem is solved.
My guess is that something went wrong at some stage of database synchronisation.