Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • The problem with my approach is that I'm doing many different queries and programmatic processing - is this not the problem? What transactions are being made against the DB on the server? I don't like the sound of sync'ing to a very 'active' server. I'd favour your first approach, and you don't need to worry about whether there are concurrent users sync'ing or not - update the server DB based on the latest date against each record. Commented Dec 15, 2015 at 14:43
  • I query first the items for the user, then do all the timestamp & delete flag checks programatically (build separate lists for items that have to be inserted, updated, and deleted), and then do these inserts / updates / deletes in a single transaction. After that do a new query to send items back to the user.
    – User
    Commented Dec 15, 2015 at 14:47
  • Problem there is that since the checks are done programatically, another client could perform an update just after I finished my programatic checks, and when I do the transaction then I'll overwrite the updates of the other client. I'm not very fluent in (My)SQL yet, not sure if there's a way I can do the whole thing in the database? If yes does that solve everything?
    – User
    Commented Dec 15, 2015 at 14:52
  • The question as it is now is a text wall. Would you format it a little bit to give it structure? Commented Dec 15, 2015 at 14:55
  • Ok, give me some mins
    – User
    Commented Dec 15, 2015 at 15:00