Database synchronisation error - is an sql bypass possible?

1
Hello, I'm trying to migrate from 3.1.1 through 4.4.2 and into 5.0.0 beta7. All went fine until the version 5, where, when trying to synchronise the data base, I run into this little gem and I am not able to start the server at all: "Request action: executeddlcommands Message: Executing DDL commands for component MyFirstComponent failed. Cause: Error (SQL State: 21000, Error Code: 0) on executing: All changes are rolled back. Stack trace: com.mendix.m2ee.api.AdminException: Executing DDL commands for component MyFirstComponent failed. at com.mendix.core.component.LocalComponent.executeDDLCommands(SourceFile:91) Caused by: com.mendix.connectionbus.ConnectionBusException: Error (SQL State: 21000, Error Code: 0) on executing: UPDATE "index$pricing_reseller"...; All changes are rolled back. at com.mendix.aS.a(SourceFile:87) Caused by: org.postgresql.util.PSQLException: ERROR: more than one row returned by a subquery used as an expression at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) (....)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:662) " Can I find and edit the SQL queries in order to skip this one? What other solutions might be possible?
asked
2 answers
2

And should you not first go to the last 3 version then move to the last 4 version. There you have a lot of cleaning up to do before you can go to 5 (and use the final 5 instead of beta 7). Certainly from 3 to 4 you have to look at all your persisitent create new actions you have to check.

Regards,

Ronald

answered
1

You can't directly change how the Modeler tries to synchronize with your database.

You can, however, perform the updates yourself (the ones that are giving you issues). Right before synchronizing you have the option to look at the queries it will run.

Find this update script and try running it yourself. It'll either work, or at the very least, give you some more information on what's going on. You can cancel out of the synch after copying down the scripts.

If you get it to work manually, you can redeploy and synchronize again. It won't need to run the script anymore (obviously).

EDIT: By checking out the script it runs, you can see the subquery that is returning more than one record, as the error states. There might be some bad data in your db for some reason. You'll at least understand the issue better.

answered