G
Guest
I'm looking at how best to synchronize a semi-connected client d/b with a central server d/b and thinking about serialized DataSets over Web Services. All well and good
On the client side I can do something like keeping a DataSet in memory and calling GetChanges() on it to send just a DiffGram of what has changed up to the server when I need to synch. This works fine; you only need to send changed data and a Command object on the server can process the DiffGram pretty much automatically
But. I then need to pick up server-side changes (made by other people, at some point in the past) and send them back down to the client to complete the synch. Obviously I can track what records are new/amended/deleted in my database. But I'd then like to do the same as the client->server leg. ie. get a DiffGram, serialize it back to the Client and use a Command object to update the client d/b. I don't want to send the whole data set back and it's obviously a much sweeter design if the same mechanism for updating is being used client and server side. Yet I can see no way to easily generate a DiffGram of my server changes. The database knows what rows are new/amended/deleted according to an internal scheme I can create, but how to end up with a DataSet whose rows have the relevant RowState? I can get there manually but it is ugly (eg. to make a row "Modified" I can make a non-destructive change to the row to change its RowState). But this surely defeats the object of using the in-built mechanism of ADO.Net. Am I missing something here
Right now the only solution I can see is to ignore DiffGrams as they seem to have this gap in what they do. I guess I can just serialize my own rows with their own flags and handle everything manually ...
On the client side I can do something like keeping a DataSet in memory and calling GetChanges() on it to send just a DiffGram of what has changed up to the server when I need to synch. This works fine; you only need to send changed data and a Command object on the server can process the DiffGram pretty much automatically
But. I then need to pick up server-side changes (made by other people, at some point in the past) and send them back down to the client to complete the synch. Obviously I can track what records are new/amended/deleted in my database. But I'd then like to do the same as the client->server leg. ie. get a DiffGram, serialize it back to the Client and use a Command object to update the client d/b. I don't want to send the whole data set back and it's obviously a much sweeter design if the same mechanism for updating is being used client and server side. Yet I can see no way to easily generate a DiffGram of my server changes. The database knows what rows are new/amended/deleted according to an internal scheme I can create, but how to end up with a DataSet whose rows have the relevant RowState? I can get there manually but it is ugly (eg. to make a row "Modified" I can make a non-destructive change to the row to change its RowState). But this surely defeats the object of using the in-built mechanism of ADO.Net. Am I missing something here
Right now the only solution I can see is to ignore DiffGrams as they seem to have this gap in what they do. I guess I can just serialize my own rows with their own flags and handle everything manually ...