Actaully i developed an Asp.net website which has a PDA app part. The case is that employees from company come in the morning and get data in their PDA’s and they work on them the whole day and in Evening they again come to office or from any web access they update the data on server. We did this through Web services because web services are remote methods so they could access that by only web access..
Now the problem is Concurrency that while syncing through web servies how to control Concurrency however their could be many employee who try to update data at a time.
In web servies we receive DataTable from PDA application and do update or insert operations through LINQ with Sql Server.
What is the use cases around the data that the clients take away with them? Are they only updating data or are they inserting new data as well?
For only updating data you need to make a decision as to whether the last value for a particular row is the correct one (e.g. commit the value with the latest timestamp) or if there is value in the other data.
When dealing with inserting data I’m going to make the assumption that your database uses an incremental primary key. In this case you won’t be able to merely commit the DataTable received from the PDA application. You will have to identify which are the new rows, then insert those new rows WITHOUT the incremental ID into the server table in order to generate a new incremental ID. You must then update the PDA’s DataTable with the new ID’s that were generated.
To deal with the actual order in which the updates are processed (multiple clients synch at the same time) I would suggest the synch process places the datasets into a queue so that the server updates are sequentially managed which makes the process a little simpler.