I am using the ReorderList control from the AJAX Control Toolkit on my fantasy cheat sheet creation site. It allows me to re-order items via AJAX requests. It appears I am running into some concurrency issues if I try to reorder records too quickly.
- If I reorder items slowly (say give a second between each reorder), there is never a problem.
- If I reorder quickly (say move a record once, then again within a second or so) only the first ordering operation is performed. Not only that, ALL FURTHER REORDERING IS IGNORED UNTIL THE PAGE IS RELOADED.
Obviously something is getting locked-up if I reorder quickly and all is lost until a page reload. It would seem to be that each reorder request (done via AJAX) would simply get queued if they come in quickly, but apparently that isn't the case. I have looked in my exception logs and no exceptions are being generated.
One important note is that this only seems to be occurring in production on my shared hosting account. On my local machine I can go as fast as I want and never run into an issue. My first instinct it to say that it is a problem with the control, but the fact that I only see the problem in a shared hosting environment makes me thing otherwise.
The code being executed on reorder is pretty simple, I call a BLL method to reorder my items in the database:
/// This method is fired each time the items are reordered
/// <param name="sender"></param>
/// <param name="e"></param>
protected void rolReorderList_ItemReorder(object sender, ReorderListItemReorderEventArgs e)
// issue the reorder call to the business layer
// we know the id of the sheet is determined by the dropdownlist
CheatSheet.ReorderCheatSheetItems(int.Parse(ddlAvailableSheets.SelectedValue), e.OldIndex, e.NewIndex);
// once the user reorders once, we note that they no longer need to see the instructional message
Profile.SiteSettings.FiguredOutReordering = true;
// we know the id of the sheet by what is stored in a session variable
CheatSheet.ReorderCheatSheetItems((int)Session[MySession.CurrentSportCode + "_" + MySession.GetCurrentVisitorSheetPosition(MySession.CurrentSportCode)], e.OldIndex, e.NewIndex);
// once the visitor reorders once, we note that they no longer need to see the instructional message
MySession.FiguredOutReordering = true;
You can see the effect here. Reorder a few items slowly then reorder, reload the page, and you'll see they're saved. Reorder a few items very quickly, reload the page, and you'll see that only the first request was processed.