<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: STOP SYNCHRONIZATION DELETE not working in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827142#M4857985</link>
    <description>&lt;P&gt;I reran the test with 40 deletes and posted the code as a new answer.&lt;/P&gt;</description>
    <pubDate>Tue, 08 May 2012 08:52:22 GMT</pubDate>
    <dc:creator>Breck_Carter</dc:creator>
    <dc:date>2012-05-08T08:52:22Z</dc:date>
    <item>
      <title>STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaq-p/13827123</link>
      <description>&lt;P&gt;I am developing an iPad application with Client-Consolidated DB synchronization model. After synchronization I am performing a cleanup operation which deletes irrelevant records from client db. My cleanup procedure has 40 delete statements. The workflow for this cleanup is: &lt;BR /&gt;
 1. &lt;CODE&gt;STOP SYNCHRONIZATION DELETE&lt;/CODE&gt;&lt;BR /&gt;
 2. Run all the delete queries.&lt;BR /&gt;
 3. &lt;CODE&gt;COMMIT&lt;/CODE&gt;&lt;BR /&gt;
 4. &lt;CODE&gt;START SYNCHRONIZATION DELETE&lt;/CODE&gt;&lt;BR /&gt;
 I have searched the documentation in which &lt;CODE&gt;COMMIT&lt;/CODE&gt; is given after &lt;CODE&gt;START SYNC&lt;/CODE&gt; command. I think it should not be the problem here. &lt;BR /&gt;
I have tested this logic by executing through &lt;CODE&gt;ULPreparedStatement::ExecuteStatement()&lt;/CODE&gt;  and from the inbuilt C++ API function &lt;CODE&gt;connection-&amp;gt;stopSynchronizationDelete()&lt;/CODE&gt;. In both cases I am getting a &lt;CODE&gt;true&lt;/CODE&gt; return value, but from the server log I can see that it is trying to upload those deletes to server.&lt;BR /&gt;
&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2012 08:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaq-p/13827123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-05T08:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827128#M4857971</link>
      <description>&lt;P&gt;Wild guess: AFAIK, MobiLink scripts should never do a COMMIT or ROLLBACK - cf. the warning from &lt;A href="http://dcx.sybase.com/index.html#1201/en/mlserver/writing-scripts-synch.html"&gt;the docs&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Caution&lt;/STRONG&gt;&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;There should be no implicit or explicit commit or rollback in your SQL synchronization scripts or the procedures or triggers that are called from your SQL synchronization scripts. COMMIT or ROLLBACK statements within SQL scripts alter the transactional nature of the synchronization steps. If you use them, MobiLink cannot guarantee the integrity of your data in the event of a failure.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 05 May 2012 15:51:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827128#M4857971</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-05T15:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827129#M4857972</link>
      <description>&lt;P&gt;Well, I may be wrong with my comment above, as the samples for STOP SYNCHRONIZATION DELETE surely do use a COMMIT, as you have stated yourself. Somewhat irritating...&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2012 15:55:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827129#M4857972</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-05T15:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827130#M4857973</link>
      <description>&lt;P&gt;Stop Synchronization Delete happens on the remotes, and is not usually in the context of Sync.  (At least I've never used it there, not sure, might be able to use it in some sp_hook procedures.)  Anyway, that's why the COMMIT/ROLLBACK restrictions don't apply here.  Sync scripts are most often used on the consolidated side.&lt;/P&gt;
&lt;P&gt;I've been able to make this work under the normal db, but can't say I've tried it using UltraLite.  I do notice that the documentation examples follow the pattern:
STOP SYNCHRONIZATION DELETE;
run the deletes
-- no commit issued
START SYNCHRONIZATION DELETE;
COMMIT;&lt;/P&gt;
&lt;P&gt;My usage has had the STOP, deletes, START in a sproc with the caller of the sproc calling the commit which matches the example patterns.  I wouldn't have necessarily expected an extra commit to matter, but I could envision it being important.  Might be worth a try.&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2012 20:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827130#M4857973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-05T20:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827131#M4857974</link>
      <description>&lt;P&gt;Sorry, just forget about the non-sense I've written above - Ron has made the point clear: &lt;EM&gt;"Stop Synchronization Delete happens on the remotes"&lt;/EM&gt;, so my hints to the sync scripts on the cons are totally off-topic. - I won't delete my wrong comments, for the single reason that I believe one can learn something from wrong conclusions, as well..&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2012 07:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827131#M4857974</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-06T07:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827132#M4857975</link>
      <description>&lt;P&gt;Another wild guess: The COMMIT turns off the STOP SYNCHRONIZATION DELETE which then causes the deletes to be processed for upload. If so, this would fall into the category of undocumented &lt;STRIKE&gt;bug&lt;/STRIKE&gt;, er, &lt;STRIKE&gt;surprise&lt;/STRIKE&gt;, um, feature.&lt;/P&gt;
&lt;P&gt;Here's a clue: the comment "-- including the stopping of the deletes" in the Help at &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/start-synchronization-delete-statement.html"&gt;http://dcx.sybase.com/index.html#1201/en/dbreference/start-synchronization-delete-statement.html&lt;/A&gt; implies that commit/rollback does have a direct effect on STOP SYNCHRONIZATION DELETE, and therefore should be executed after the START.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2012 09:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827132#M4857975</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-06T09:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827124#M4857967</link>
      <description>&lt;P&gt;Hi Guys,  Thanks a lot to all for their valuable comments, no matter they are just guesses but they gave me idea to work with a different approach which i was considering worthless. I tried it with the sequence though i have to do some code rearrangement and modification.&lt;BR /&gt;
1) STOP SYNCHRONIZATION DELETE&lt;BR /&gt;
2) DELETE &lt;BR /&gt;
3) START SYNCHRONIZATION DELETE&lt;BR /&gt;
4) COMMIT&lt;BR /&gt;
and this worked just fine.
    I think &lt;EM&gt;Volker&lt;/EM&gt; you are right, this COMMIT is affecting the behavior of STOP SYNC command and it seems applicable to remote DB too though you mentioned it off-topic. Special thanks to you for mentioning the same. You saved me.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 06:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827124#M4857967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-07T06:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827133#M4857976</link>
      <description>&lt;P&gt;Glad you got it working - and feel free to "accept" your own answer.&lt;/P&gt;
&lt;P&gt;For what I see, the credits w.r.t. COMMIT vs. STOP SYNC should go to Breck, not me:)&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 07:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827133#M4857976</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-07T07:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827134#M4857977</link>
      <description>&lt;P&gt;The credit should go to Gandalf himself, who raised the issue in the original question and then discounted it: "... I have searched the documentation in which COMMIT is given after START SYNC command. I think it should not be the problem here."&lt;/P&gt;
&lt;P&gt;I agree that "it should not be the problem" but life isn't always agreeable &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 09:32:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827134#M4857977</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-07T09:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827135#M4857978</link>
      <description>&lt;P&gt;Well, in case it's "Gandalf the White", he won't need further credits:)&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 09:36:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827135#M4857978</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-07T09:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827125#M4857968</link>
      <description>&lt;P&gt;Sorry Guys, but the order of 'commit' and 'start sync delete' statements doesn't make any difference. Nor does 'commit' reset or affect the stop-sync-delete status/flag. All that matters is which delete-mode is in effect when the delete statement itself is executed. (This is a little better than a wild guess, hopefully, since I've checked the code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, I'm afraid something more is going on here.&lt;/P&gt;
&lt;P&gt;What sometimes does cause confusion with stop-sync-delete is the following sequence:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;insert a row&lt;/LI&gt;
&lt;LI&gt;stop sync delete&lt;/LI&gt;
&lt;LI&gt;delete that row&lt;/LI&gt;
&lt;LI&gt;start sync delete&lt;/LI&gt;
&lt;LI&gt;synchronize&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What will be uploaded on the synchronize? The delete will not of course, but the &lt;EM&gt;insert&lt;/EM&gt; of the row will. This is different than the following, where nothing is uploaded on the final synchronize:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;insert a row&lt;/LI&gt;
&lt;LI&gt;synchronize (uploads that new row)&lt;/LI&gt;
&lt;LI&gt;stop sync delete&lt;/LI&gt;
&lt;LI&gt;delete that row&lt;/LI&gt;
&lt;LI&gt;start sync delete&lt;/LI&gt;
&lt;LI&gt;synchronize&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The other normal cases are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;insert a row&lt;/LI&gt;
&lt;LI&gt;delete that row (no stop-sync-delete here)&lt;/LI&gt;
&lt;LI&gt;synchronize (nothing goes up)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;insert a row&lt;/LI&gt;
&lt;LI&gt;synchronize (uploads the insert)&lt;/LI&gt;
&lt;LI&gt;delete that row&lt;/LI&gt;
&lt;LI&gt;synchronize (uploads the delete)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 07 May 2012 14:09:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827125#M4857968</guid>
      <dc:creator>former_SQLA_member1694876</dc:creator>
      <dc:date>2012-05-07T14:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827136#M4857979</link>
      <description>&lt;P&gt;...and we know that "reading the code" beats "testing the code" every time, right? &amp;lt;bg&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 14:36:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827136#M4857979</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-07T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827137#M4857980</link>
      <description>&lt;P&gt;...and a test using 12.0.1.3298 does agree with Tim's reading of the code: it doesn't matter where the COMMIT goes, before or after the START SYNCHRONIZATION DELETE; either way, the row deleted on the remote database after the STOP SYNCHRONIZATION DELETE is not deleted from the consolidated.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 15:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827137#M4857980</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-07T15:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827138#M4857981</link>
      <description>&lt;P&gt;Did you change more than one thing? ...because my test indicates that it doesn't matter whether the COMMIT is before or after the START SYNCHRONIZATION DELETE.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 15:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827138#M4857981</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-07T15:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827139#M4857982</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(Truth be told I'm old enough that I did indeed monkey around a bit with a test as well before posting... But there's only so much time you know... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 15:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827139#M4857982</guid>
      <dc:creator>former_SQLA_member1694876</dc:creator>
      <dc:date>2012-05-07T15:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827140#M4857983</link>
      <description>&lt;P&gt;Hi Breck, I didn't change anything in sync model. Only the cleanup routine i rearranged. As in my solution i was performing all 40 DELETE statements required for me without committing them, then i START the sync and did the commit. this approach didn't upload any change happened due to DELETEs to consolidated database.&lt;BR /&gt;
Can you please specify what kind of test you ran? Have you ran more than 1 deletes? If you run only one 1 delete it won't produce my scenario.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 02:59:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827140#M4857983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-08T02:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827126#M4857969</link>
      <description>&lt;P&gt;Guys, i think i need to explain my whole Sync model scenario.&lt;BR /&gt;
 1. I have Client DB which can be divided in 3 set of tables lets say : 1)SET-A    2)SET-B     3) SET-C&lt;BR /&gt;
 2. SET-A - Daily transaction for my activities. INSERT, DELETE,UPDATE of new records.&lt;BR /&gt;
 3. SET-B - Lookup tables only. data will depend on my current working region(geographical) and will be downloaded from server. No insert , update is allowed in this set.&lt;BR /&gt;
 4. SET-C - Same as point 3.&lt;BR /&gt;
 5. Now if from backend my region got changed i will get new data set but previous data will also be there in remote DB, i need to delete those records. I will be performing 40 delete statements for that. But that data is relevant for other(it is common data) Users and should not be deleted from server.&lt;BR /&gt;
 6. I have 3 Sync publications lets say :- 1) Sync1  2) Sync2   3) Sync3&lt;BR /&gt;
 7. Very first time i will run all 3 publications which gives me complete DB.&lt;BR /&gt;
 8. Subsequently i will Run &lt;EM&gt;Sync2&lt;/EM&gt; or &lt;EM&gt;Sync3&lt;/EM&gt; with &lt;EM&gt;Sync1&lt;/EM&gt; based upon a logic.&lt;BR /&gt;
 9. Let say region change happened for me, i will run &lt;EM&gt;Sync1&lt;/EM&gt; &amp;amp; &lt;EM&gt;Sync2&lt;/EM&gt;, and i need to delete unwanted records in client DB.&lt;BR /&gt;
 10. Next time i will run &lt;EM&gt;Sync1&lt;/EM&gt; with &lt;EM&gt;Sync3&lt;/EM&gt; and don't want the deletes to reflect on server.&lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;That's it. Now when i was trying with the approach i mentioned in question, from the Mobilink server log i was able to see that sync is trying to upload those DELETEs on it(i have tested it for 3 different &lt;STRONG&gt;mlreoteid&lt;/STRONG&gt;s). But with the approach i used in solution it does not happen which solved my problem. &lt;BR /&gt;
&lt;STRONG&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/215/tim-mcclements/"&gt;@Tim&lt;/A&gt;&lt;/STRONG&gt; : So for a second lets say &lt;STRONG&gt;COMMIT&lt;/STRONG&gt; affect the &lt;STRONG&gt;STOP&lt;/STRONG&gt; sync command behavior and we have a solution, so in your case1 if you execute only one delete statement it won't produce this scenario because &lt;STRONG&gt;STOP&lt;/STRONG&gt; got &lt;EM&gt;altered&lt;/EM&gt; but we are not doing any DELETE after that. &lt;BR /&gt;
But if it does not affect the &lt;STRONG&gt;STOP&lt;/STRONG&gt; command, then i have no clue what's going on there as I am an XCode developer and don't know much about DB, Sync Models processing, this is my first project involved with DB.   &lt;BR /&gt;
&lt;/P&gt;
&lt;P&gt;Thanks again to all for their valuable comments &amp;amp; explanation&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 05:17:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827126#M4857969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-05-08T05:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827141#M4857984</link>
      <description>&lt;P&gt;IMHO, the replacement of "unfitting" regional data with "fitting one" simply looks like &lt;STRONG&gt;some kínd of "territory realignment"&lt;/STRONG&gt; problem, which is a common situation for mobile databases.&lt;/P&gt;
&lt;P&gt;Here, you would not need to delete the data explicitly on the remote but would rely on a download_cursor script to get the "fresh data" and a "download_delete_cursor" script to delete the "old data".&lt;/P&gt;
&lt;P&gt;Cf. &lt;A href="http://dcx.sybase.com/index.html#1201/en/mlstart/customer-contact-ml-synchtech.html"&gt;this doc page&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 05:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827141#M4857984</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-05-08T05:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827127#M4857970</link>
      <description>&lt;P&gt;Here's the test I just ran using SQL Anywhere 12.0.1.3298. It shows that STOP SYNCHRONIZATION DELETE prevented 40 DELETE operations from being uploaded even though the COMMIT preceded the START SYNCHRONIZATION DELETE.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
001_setup_cons_remo.bat
&lt;PRE&gt;"%SQLANY12%bin32dbinit.exe" cons.db&lt;P&gt;&lt;/P&gt;
&lt;P&gt;"%SQLANY12%bin32dbspawn.exe" -f "%SQLANY12%bin32dbeng12.exe" -o dbeng12_log_cons.txt -os 1M -x none cons.db &lt;/P&gt;
&lt;P&gt;&lt;A href="http://&amp;quot;%SQLANY12%\x02klzzwxh:0011\x03in32\x02klzzwxh:0012\x03bisql.com"&gt;"%SQLANY12%bin32dbisql.com&lt;/A&gt;" -c "ENG=cons;DBN=cons;UID=dba;PWD=sql" READ ENCODING Cp1252 "%SQLANY12%MobiLinksetupsyncsa.sql"&lt;/P&gt;
&lt;P&gt;PAUSE&lt;/P&gt;
&lt;P&gt;&lt;A href="http://&amp;quot;%SQLANY12%\x02klzzwxh:0017\x03in32\x02klzzwxh:0018\x03bisql.com"&gt;"%SQLANY12%bin32dbisql.com&lt;/A&gt;" -c "ENG=cons;DBN=cons;UID=dba;PWD=sql" READ ENCODING Cp1252 001s_script_to_setup_cons.sql&lt;/P&gt;
&lt;P&gt;PAUSE&lt;/P&gt;
&lt;P&gt;REM Use bin32 if running on 32-bit Windows...&lt;/P&gt;
&lt;P&gt;"%SQLANY12%bin64dbdsn.exe" -ws cons -y -c "ENG=cons;DBN=cons;UID=dba;PWD=sql"&lt;/P&gt;
&lt;P&gt;PAUSE&lt;/P&gt;
&lt;P&gt;"%SQLANY12%bin32dbinit.exe" remo.db&lt;/P&gt;
&lt;P&gt;"%SQLANY12%bin32dbspawn.exe" -f "%SQLANY12%bin32dbeng12.exe" -o dbeng12_log_remo.txt -os 1M -x none remo.db &lt;/P&gt;
&lt;P&gt;&lt;A href="http://&amp;quot;%SQLANY12%\x02klzzwxh:0028\x03in32\x02klzzwxh:0029\x03bisql.com"&gt;"%SQLANY12%bin32dbisql.com&lt;/A&gt;" -c "ENG=remo;DBN=remo;UID=dba;PWD=sql" READ ENCODING Cp1252 001s_script_to_setup_remo.sql&lt;/P&gt;
&lt;P&gt;PAUSE&lt;/P&gt;
&lt;P&gt;&lt;A href="http://&amp;quot;%SQLANY12%\x02klzzwxh:0031\x03in32\x02klzzwxh:0032\x03bisql.com"&gt;"%SQLANY12%bin32dbisql.com&lt;/A&gt;" -c "ENG=cons;DBN=cons;UID=dba;PWD=sql"&lt;/P&gt;
&lt;P&gt;&lt;A href="http://&amp;quot;%SQLANY12%\x02klzzwxh:0034\x03in32\x02klzzwxh:0035\x03bisql.com"&gt;"%SQLANY12%bin32dbisql.com&lt;/A&gt;" -c "ENG=remo;DBN=remo;UID=dba;PWD=sql"&lt;/P&gt;
&lt;P&gt;PAUSE All done...
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
001s_script_to_setup_cons.sql
&lt;PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Define GLOBAL AUTOINCREMENT partition number.&lt;/P&gt;
&lt;P&gt;SET OPTION PUBLIC.GLOBAL_DATABASE_ID = '0';&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;BEGIN
   DROP TABLE d;
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;P&gt;CREATE TABLE d (
   key_1         UNSIGNED BIGINT NOT NULL 
                    DEFAULT GLOBAL AUTOINCREMENT ( 1000000000 ),
   non_key_1     VARCHAR ( 100 ) NOT NULL DEFAULT '',
   last_updated  TIMESTAMP NOT NULL DEFAULT TIMESTAMP,
   PRIMARY KEY ( key_1 ) );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CALL ml_add_table_script  ( 'v1', 'd', 'upload_insert', NULL );
CALL ml_add_table_script  ( 'v1', 'd', 'upload_insert', '
INSERT d
       ( key_1,
         non_key_1 )
VALUES ( ?,
         ? )' );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CALL ml_add_table_script  ( 'v1', 'd', 'upload_update', NULL );
CALL ml_add_table_script  ( 'v1', 'd', 'upload_update', '
UPDATE d
   SET non_key_1 = ?
 WHERE key_1 = ?' );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CALL ml_add_table_script  ( 'v1', 'd', 'upload_delete', NULL );
CALL ml_add_table_script  ( 'v1', 'd', 'upload_delete', '
DELETE d
 WHERE key_1 = ?' );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CALL ml_add_table_script  ( 'v1', 'd', 'download_cursor', NULL );
CALL ml_add_table_script  ( 'v1', 'd', 'download_cursor', '
SELECT key_1,
       non_key_1
  FROM d
 WHERE last_updated &amp;gt;= ?' );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CALL ml_add_table_script  ( 'v1', 'd', 'download_delete_cursor', NULL );
CALL ml_add_table_script  ( 'v1', 'd', 'download_delete_cursor', '--{ml_ignore}' );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Insert rows to download and then delete.&lt;/P&gt;
&lt;P&gt;BEGIN
DECLARE @rowcount INTEGER;
SET @rowcount = 1;
WHILE @rowcount &amp;lt;= 100 LOOP
   INSERT d VALUES ( DEFAULT, DEFAULT, DEFAULT );
   SET @rowcount = @rowcount + 1;
END LOOP;
COMMIT;
END;
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
001s_script_to_setup_remo.sql
&lt;PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Define GLOBAL AUTOINCREMENT partition number.&lt;/P&gt;
&lt;P&gt;SET OPTION PUBLIC.GLOBAL_DATABASE_ID = '1';&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;BEGIN
   REVOKE CONNECT FROM REMOTE_DBA;
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;P&gt;GRANT CONNECT TO REMOTE_DBA IDENTIFIED BY SQL;
GRANT REMOTE DBA TO REMOTE_DBA;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;BEGIN
   DROP SYNCHRONIZATION SUBSCRIPTION TO p1 FOR "1";
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;P&gt;BEGIN
   DROP SYNCHRONIZATION USER "1";
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;P&gt;BEGIN
   DROP PUBLICATION p1;
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;BEGIN
   DROP TABLE d;
   EXCEPTION WHEN OTHERS THEN
END;&lt;/P&gt;
&lt;P&gt;CREATE TABLE d (
   key_1         UNSIGNED BIGINT NOT NULL 
                    DEFAULT GLOBAL AUTOINCREMENT ( 1000000000 ),
   non_key_1     VARCHAR ( 100 ) NOT NULL DEFAULT '',
   last_updated  TIMESTAMP NOT NULL DEFAULT TIMESTAMP,
   PRIMARY KEY ( key_1 ) );&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;CREATE PUBLICATION p1 (
   TABLE d  ( key_1,
              non_key_1 ) );&lt;/P&gt;
&lt;P&gt;CREATE SYNCHRONIZATION USER "1" TYPE tcpip;&lt;/P&gt;
&lt;P&gt;CREATE SYNCHRONIZATION SUBSCRIPTION TO p1 FOR "1";
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
002_run_mlsrv12.bat
&lt;PRE&gt;"%SQLANY12%bin64mlsrv12.exe"^
  -c "DSN=cons;UID=dba;PWD=sql"^
  -o mlsrv12_log_cons.txt^
  -os 10M^
  -ppv 60^
  -vcefhkmnopstuU^
  -zu+ 
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
003_run_dbmlsync.bat
&lt;PRE&gt;"%SQLANY12%bin32dbmlsync.exe"^
  -c "ENG=remo;DBN=remo;UID=REMOTE_DBA;PWD=SQL"^
  -e "adr='host=localhost';sv=v1"^
  -o dbmlsync_log_remo.txt^
  -os 10M^
  -vnosu^
  -x
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;
004_test_STOP_SYNCHRONIZATION_DELETE.sql
&lt;PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Run initial sync.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Run this on remote database...&lt;/P&gt;
&lt;P&gt;STOP SYNCHRONIZATION DELETE;
DELETE d WHERE key_1 &amp;lt;= 40;
COMMIT;
START SYNCHRONIZATION DELETE;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Run second sync.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;-- Run this on consolidated database...&lt;/P&gt;
&lt;P&gt;SELECT * FROM d;&lt;/P&gt;
&lt;P&gt;key_1,non_key_1,last_updated
1,'','2012-05-08 08:42:21.104'
2,'','2012-05-08 08:42:21.137'
...
40,'','2012-05-08 08:42:21.140'
41,'','2012-05-08 08:42:21.140'
42,'','2012-05-08 08:42:21.140'
...
100,'','2012-05-08 08:42:21.143'
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 08:51:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827127#M4857970</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-08T08:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: STOP SYNCHRONIZATION DELETE not working</title>
      <link>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827142#M4857985</link>
      <description>&lt;P&gt;I reran the test with 40 deletes and posted the code as a new answer.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 08:52:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/stop-synchronization-delete-not-working/qaa-p/13827142#M4857985</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2012-05-08T08:52:22Z</dc:date>
    </item>
  </channel>
</rss>

