> This is definitely more of a general AJAX topic than a JQuery question > per se. What are some strategies for avoiding concurrency errors when > updating a database through AJAX? That is, what are some ways to > prevent a given user from modifying the same row in a database with > simultaneous requests (say, that he updates one column with an AJAX > call, then immediately submits a form that updates the same row). How
I'd say this is the same problem you have whenever you don't have a single user application. My favourite strategy is optimistic locking, but there are other options out there: http://en.wikipedia.org/wiki/Optimistic_concurrency_control btw, I tend to use a timestamp or integer version number. > have other people solved this problem? Is the best option to make the > AJAX call synchronous? never make synchronous ajax calls. even though it might take more time, you should always design your app so that it won't use ajax sync calls (sync calls will block the browser and nobody wants that, right?) -- Regards, Luis Abreu email: labreu_at_gmail.com PT Blog: http://weblogs.pontonetpt.com/luisabreu EN Blog:http://msmvps.com/blogs/luisabreu/default.aspx http://www.pontonetpt.com MVP profile: http://mvp.support.microsoft.com/profile/luis.abreu