Hi all, Can anybody help in the following situation: 1- I am using mobilink synchronization (SQL Anywhere 10) between two databases (Consol1, Remote1). 2- The offset of transaction log on Remote1 is set to X. 3- I execute insert1 statement on Remote1, then commit: the offset is now X+A. 4- I execute insert2 statement on Remote1, then commit: the offset is now X+A+B. I want to exclude the insert1 from being synchornized to Consol1, but keep the insert2 to be synchonized (i.e. ignore the block in transaction log from X => X+A). Is there any solution? I changed the values 'progress' and 'log_sent' of table SYSSYNC into X+A by calling the procedure sa_sync_sub, but it didn't work. Any ideas? Thanks in advance |
Once insert1 has been written to the transaction log, there is no supported way to tell dbmlsync to ignore the operation short of dropping then recreating the synchronization subscription, but that would also cause insert2 to be skipped. theorically there is now way, but I am looking for a solution
(16 Mar '17, 09:14)
Baron
|
The 'upload_insert' script for the table in question can be written as a CALL to a stored procedure that contains an unlimited amount of complex logic, including logic that decides whether to process or ignore the uploaded row. Of course, that implies enough information is available to make that decision. If that information is uploaded separately, one approach is for the 'upload_insert' to insert the rows in a temporary table and then make the decision to copy rows in the real table or not in the 'end upload' connection event. Many applications include complex logic in the synchronization scripts... it is one of the hallmarks of MobiLink. Thanks a lot. Very nice trick
(16 Mar '17, 08:59)
Baron
Replies hidden
Thanks for the reply again, but could you send me an example how can I build logic for deciding whether to process or ignore the uploaded row? I need to have a logic based on the value being sent from remote (i.e. the value of {ml.r "column_name"}
(17 May '17, 14:44)
Baron
1
I don't have a sample but you could simply insert/upload the values "normally" but in a different table (with same schema as the real table) on the consolidated (*) and then use an end_upload_rows event to only insert/update those rows in the "real" table that have been uploaded into the temporary table and have the desired value. After doing the "move", you would "clean" the temporary table. - I hope you get the idea. (*) So your upload_insert script would look "normal" except it operates on a different table.
(17 May '17, 15:03)
Volker Barth
Do you mean that the end_upload_rows will read from the temporary table and write in the real table?
(17 May '17, 15:20)
Baron
|
One more question, in another scenario when the transaction log file on remote was damaged, and I want to bring the remote DB into synchronization (up the point after creating new transaction log file). So that I will need to force the dbmlsync to ignore the values of 'progress'/'log_sent' in table SYSSYNC and consider only the lines in transaction log file up a certain offset. Or in other way, to set the values of 'progress'/'log_sent' in table SYSSYNC to a certain offset value. 1
Droping and re-creating the synchronization subscription will reset the values in the SYSSYNC table.
(16 Mar '17, 09:31)
Reg Domaratzki
|