Single vs. Multiple User Issues

About to head off to bed after staying too late at work tonight…

A discussion in a meeting today made me realize that I’m not doing any concurrent user checking or handing in my gallery and tasks applications. For example, if one person pulls up a photo and adds some information to it and another person pulls up the same photo and begins adding information at the same time, whoever saves first will have their changes overwritten when the other person saves the same record after them. The easy solution is to pass the last modified date/time (which I already have) in a hidden field and before saving the record, check to make sure that date/time matches what is currently still in the database.

What comes next is more tricky… the "proper" way to handle this in my opinion is to then show the user both their data and the data that is currently in the database and let them edit/merge the changes from one record into the other or choose only one of the records to keep. This means I need to build out another screen with 2 edit forms and a radio button switcher or something. The right solution is always more work 😐