in reply to How to deal with data race issues with Perl?

The lo-tek solution I've used is to have a "time of last change" sent out and submitted back with each dataset. If the time of "last change" in the database and the time of "last change" (re)submitted are different, the change is rejected because there is a conflict.

The high-tech solution would be something like version control, but for that, you really need to be far more specific as for what kind of data you have and what operations are to be performed on it. The two "easy" solutions I can envision would be to use something like git to handle the merging of two datasets, or alternatively, recording all changes to the dataset (instead of the result), and then replaying all changes on the server when a client synchronizes. Of course, conflicts will happen. Conflict resolution is likely something that needs a social/organizational solution.

  • Comment on Re: How to deal with data race issues with Perl?

Replies are listed 'Best First'.
Re^2: How to deal with data race issues with Perl?
by halfbaked (Sexton) on Dec 28, 2010 at 16:13 UTC

    I actually think conflicts will be fairly infrequent, so perhaps just asking the user what they want to do is probably is the easiest and least confusing for them.

    Or just make the last write the one that wins and just do my best to educate users as to why the data they saved isn't there anymore.

    The data will be tiny chunks that are not earth-shattering if they get lost.