Exception synchronising database: - -

1
Hi there, While synchronising an MSSQL Database using database replication, I receive the following error: As far as I can see, it successfully runs the query to retrieve the tables - and I can see them but, when trying to fetch columns/attributes, it fails. Below is the stacktrace: Exception synchronising database: <IPAddress> - MDAManagerTest - -------- com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: replication.ReplicationSettings$MendixReplicationException: Could not execute the following OQL query: //DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL] at com.mendix.core.Core.execute(SourceFile:225) Caused by: com.mendix.core.CoreRuntimeException: replication.ReplicationSettings$MendixReplicationException: Could not execute the following OQL query: //DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL] at hC.b(SourceFile:194) Caused by: replication.ReplicationSettings$MendixReplicationException: Could not execute the following OQL query: //DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL] at replication.MetaInfo.removeUnchangedObjectsByQuery(MetaInfo.java:715) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreRuntimeException: Exception occurred in action '{"amount":525,"sort":{},"offset":0,"type":"RetrieveXPathAction","depth":0,"xpath":"//DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL]"}', all database changes executed by this action were rolled back at hC.b(SourceFile:194) Caused by: com.mendix.core.CoreRuntimeException: Exception occurred in action '{"amount":525,"sort":{},"offset":0,"type":"RetrieveXPathAction","depth":0,"xpath":"//DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL]"}', all database changes executed by this action were rolled back at com.mendix.core.actionmanagement.CoreAction.c(SourceFile:515) Caused by: n: An exception has occurred for the following request(s): fu (depth = 0, amount = 525): //DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL] at x.a(SourceFile:57) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Input '//DatabaseReplication.Table[DbId=3][UpdateCounter!= 1 OR UpdateCounter=NULL]' could not be parsed Error on line 1 character 54: mismatched input 'OR' expecting ']' at jl.a(SourceFile:27) at jl.a(SourceFile:14) at jk$a.a(SourceFile:17) at jk$a.apply(SourceFile:16) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:76) at jl.a(SourceFile:16) at jE.a(SourceFile:16) at jE.a(SourceFile:28) at fl.a(SourceFile:107) at fl.a(SourceFile:90) at dQ.a(SourceFile:37) at fu.getSuitableRequest(SourceFile:31) at dE.a(SourceFile:63) at x.a(SourceFile:43) at h.a(SourceFile:269) at hu.b(SourceFile:126) at hu.a(SourceFile:67) at hq.a(SourceFile:61) at hq.executeAction(SourceFile:21) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:183) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:1043) at com.mendix.core.Core.retrieveXPathQuery(SourceFile:1197) at replication.MetaInfo.removeUnchangedObjectsByQuery(MetaInfo.java:712) at databasereplication.implementation.DataManager.removeUnchangedObjectsByQuery(DataManager.java:361) at databasereplication.implementation.SQLServerReader.processTables(SQLServerReader.java:40) at databasereplication.actions.SyncDatabaseInfo.executeAction(SyncDatabaseInfo.java:50) at databasereplication.actions.SyncDatabaseInfo.executeAction(SyncDatabaseInfo.java:27) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:183) at com.mendix.core.Core.execute(SourceFile:219) at lh.a(SourceFile:69) at mg.a(SourceFile:73) at mf.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hC.b(SourceFile:183) at com.mendix.core.Core.execute(SourceFile:219) at gm.execute(SourceFile:186) at iW.a(SourceFile:304) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:141) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:133) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:131) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:127) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192)
asked
1 answers
0

Alistair,

The log states that the OQL query cannot be parsed. Seems to be the like an issue as in xpath when adding a xpath to a grid in the modeler like:

[Attribute='3'][(Attribute2 = '1' OR Attribute2 = '2')]

This will return and error: mismatched input 'OR' expecting BRACKET_CLOSE

When replacing this with the lowercase 'or' like:

[Attribute='3'][Attribute2 = '1' or Attribute2 = '2']

The statement is valid again. It might be that the OQL query is malformed and you'll need to find where this is created/situated and amend it there, as I don't know the database replicator in detail I can't provide a more detailed answer, but I hope this will point you in the direction of a solution.

answered