How to manage updates in a multi-user environment
Posted: Thu Apr 28, 2016 1:40 pm
I'm currently putting together a design for a multi-user desktop application where I'm intending to populate livecode grids via SQL select statements.
It will be possible for a user to update a record within the grid which will then trigger an SQL update for that record. My problem is that it's possible another user may have updated the same record between the first user downloading a copy into the grid and performing their update.
My initial thought is to include a 'version' field in the SQL table that is incremented each time the record is updated and to check that it has not been changed between download and update - if a change is detected then I can run a comparison of the 2 versions and decide what action to take depending on what has changed where.
Does anyone use an alternative method to manage this issue or have any comments to make on this option?
Thanks for any feedback.
Jon.
It will be possible for a user to update a record within the grid which will then trigger an SQL update for that record. My problem is that it's possible another user may have updated the same record between the first user downloading a copy into the grid and performing their update.
My initial thought is to include a 'version' field in the SQL table that is incremented each time the record is updated and to check that it has not been changed between download and update - if a change is detected then I can run a comparison of the 2 versions and decide what action to take depending on what has changed where.
Does anyone use an alternative method to manage this issue or have any comments to make on this option?
Thanks for any feedback.
Jon.