Hi to all!
It just happens that i stumbled accross this problem. After a little investigation this is what i could come up with:
1. Updating the same record from another place before the first update was comitted causes an DBConcurrencyException to occur (this is raised by DataAdpater.Update() when no. of affected rows equals 0, aka original record is not found and update is unsuccesfull). Nothing wrong here, this is Optimistic Concurrency.
2. Although specificly handled in TaskVision code (catch DBConcurrencyException), the code hangs up when trying to marshal back the DataSet that contains the conflicting row. I don't really get why this happens, but if you clear the RowError, the code will stop hanging up.
3. Though not hangging up, if you clear the RowError, you*space space*the code's functionallity (the whole point is to return the conflicting row back to the client). The solution i came up with is to return back only the single conflicting row (not the entire set of rows that was sent for the update), but clearing the error before sending. To signal error when a concurrency exception, the table returned is named "TaskErrors" not "Tasks". Not a very elegant solution i know (in fact it was my first ideea), but it serves it's purpose.
Hope this helps someone. |