cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

STOP SYNCHRONIZATION DELETE not working

Former Member
7,738

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:
1. STOP SYNCHRONIZATION DELETE
2. Run all the delete queries.
3. COMMIT
4. START SYNCHRONIZATION DELETE
I have searched the documentation in which COMMIT is given after START SYNC command. I think it should not be the problem here.
I have tested this logic by executing through ULPreparedStatement::ExecuteStatement() and from the inbuilt C++ API function connection->stopSynchronizationDelete(). In both cases I am getting a true return value, but from the server log I can see that it is trying to upload those deletes to server.

View Entire Topic
Former Member

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.
1) STOP SYNCHRONIZATION DELETE
2) DELETE
3) START SYNCHRONIZATION DELETE
4) COMMIT
and this worked just fine. I think Volker 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.

VolkerBarth
Contributor
0 Likes

Glad you got it working - and feel free to "accept" your own answer.

For what I see, the credits w.r.t. COMMIT vs. STOP SYNC should go to Breck, not me:)

Breck_Carter
Participant

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."

I agree that "it should not be the problem" but life isn't always agreeable 🙂

VolkerBarth
Contributor
0 Likes

Well, in case it's "Gandalf the White", he won't need further credits:)

Breck_Carter
Participant
0 Likes

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.

Former Member
0 Likes

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.
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.

Breck_Carter
Participant
0 Likes

I reran the test with 40 deletes and posted the code as a new answer.