cancel
Showing results for 
Search instead for 
Did you mean: 

mobilink event upload_update has unexpected results

0 Kudos
1,379

We use time stamp based synchronization and a table that is in both a consolidated and remote db. This table synchronizes updates from the consolidated to the remote. We don't want the remote updating this table so we have triggers that prevent this on the remote. Then, on the consolidated we have an upload_update event script that looks like this:

update owner.table set last_modified_ts = now(*) where table-pk= {ml r.table-pk}

So, if someone at the remote is determined to update that table the consolidated will not update but then will send the consolidated value back to the remote in the download_cursor based on the last_modified_ts being updated.

This has been working. But in testing yesterday I saw this:

I updated a value at the remote. The column I updated had a data type of varchar(7). Consolidated and remote match with this data type.

I updated the last character in the column like this at the remote: original value: testing updated value: testina

Then synchronized. The consolidated was not updated as expected. But the consolidated did not send its value back to the remote. I saw this in the mobilink server logfile:

I. 2019-03-28 09:33:38. <4> upload_update table I. 2019-03-28 09:33:38. <4> UPDATE owner.table SET Last_Modified_ts = now() WHERE VALUE = {ml r.VALUE}; I. 2019-03-28 09:33:38. <4> Translated SQL: I. 2019-03-28 09:33:38. <4> UPDATE owner.table SET Last_Modified_ts = now() WHERE VALUE = ?; I. 2019-03-28 09:33:38. <4> Update row (new remote values) [table]: I. 2019-03-28 09:33:38. <4>
I. 2019-03-28 09:33:38. <4> testina

I. 2019-03-28 09:33:39. <4> download_cursor table I. 2019-03-28 09:33:39. <4> SELECT VALUE, DATA1 I. 2019-03-28 09:33:39. <4> FROM owner.table t I. 2019-03-28 09:33:39. <4> WHERE t.last_modified_ts >= {ml s.last_table_download} I. 2019-03-28 09:33:39. <4> Translated SQL: I. 2019-03-28 09:33:39. <4> SELECT VALUE, DATA1 I. 2019-03-28 09:33:39. <4> FROM owner.table t I. 2019-03-28 09:33:39. <4> WHERE t.last_modified_ts >= ? I. 2019-03-28 09:33:39. <4> System variable last_table_download value: 2019-03-28 09:32:46.802000 I. 2019-03-28 09:33:39. <4> Insert/Update row [table]: I. 2019-03-28 09:33:39. <4>
I. 2019-03-28 09:33:39. <4> testing I. 2019-03-28 09:33:39. <4> Ignoring redundant row

Does "Ignoring redundant row" mean it's not sending the consolidated value back to the remote? Which is what I'm assuming.

I did some further testing and the redundant row only seems to come up when the character length of the value isn't updated but a character in the value is updated. If I update the value to "test" changing the length, then the consolidated sends the update to the remote. But if I update the value to "testina", still 7 characters, it will not send the update.

What constitutes an "update" for the download_cursor to send an update to the remote? From what I understand, the upload is compared to the download and if they match then you get the redundant row information line. Is this correct?

Appreciate the help.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Thank you Breck and Volker. What we had is a table with a funky primary key ( a blank ' ') and a reserved word used as the value in the varchar(7) column ('unknown'). We decided to change the 'unknown' to 'UNK' and that did give the expected behavior.

Answers (0)