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

asked 15 Mar, 11:41

Sarkis's gravatar image

Sarkis
1802318
accept rate: 0%


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.

permanent link

answered 15 Mar, 11:46

Reg%20Domaratzki's gravatar image

Reg Domaratzki
5.2k33575
accept rate: 41%

theorically there is now way, but I am looking for a solution

(16 Mar, 09:14) Sarkis

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.

permanent link

answered 16 Mar, 08:19

Breck%20Carter's gravatar image

Breck Carter
25.7k427586845
accept rate: 20%

Thanks a lot. Very nice trick

(16 Mar, 08:59) Sarkis
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, 14:44) Sarkis
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, 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, 15:20) Sarkis

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.

permanent link

answered 16 Mar, 09:14

Sarkis's gravatar image

Sarkis
1802318
accept rate: 0%

1

Droping and re-creating the synchronization subscription will reset the values in the SYSSYNC table.

(16 Mar, 09:31) Reg Domaratzki
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290

question asked: 15 Mar, 11:41

question was seen: 124 times

last updated: 17 May, 15:20