on ‎2012 May 05 9:15 AM
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.
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 🙂
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.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.