cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

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 😉

So, I'm afraid something more is going on here.

What sometimes does cause confusion with stop-sync-delete is the following sequence:

  • insert a row
  • stop sync delete
  • delete that row
  • start sync delete
  • synchronize

What will be uploaded on the synchronize? The delete will not of course, but the insert of the row will. This is different than the following, where nothing is uploaded on the final synchronize:

  • insert a row
  • synchronize (uploads that new row)
  • stop sync delete
  • delete that row
  • start sync delete
  • synchronize

The other normal cases are:

  • insert a row
  • delete that row (no stop-sync-delete here)
  • synchronize (nothing goes up)

and

  • insert a row
  • synchronize (uploads the insert)
  • delete that row
  • synchronize (uploads the delete)
Breck_Carter
Participant

...and we know that "reading the code" beats "testing the code" every time, right? <bg>

Breck_Carter
Participant

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

🙂

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