This question is locked. New answers and comments are not allowed.
I am using VS 2010, Telerik WPF controls (WPF using the MVVM pattern), WCF (TCP/binary) and OpenAccess.
I have a scenario where I need to perform continuous updates, sometimes to the same piece of data. For example, I have a RadNumericUpDown control that is bound to a model-view, where every change to the value will result in an update. This works reasonably well but sometimes I get an error that indicates that the update might be using cached data.
If I'm trying to update column C in Table T, with column A being the PK (Identity), the OA-generated SQL follows this sort of format:
The WCF calls are ordered, so I know that they are being executed in the correct sequence. I'm using the OA Domain Model, where I query the table by PK and then make my changes before committing. The error I receive suggests that the value assigned to C in the "AND C=?" clause is actually the value that existed before the previous call, so of course the row is not found.
I have a scenario where I need to perform continuous updates, sometimes to the same piece of data. For example, I have a RadNumericUpDown control that is bound to a model-view, where every change to the value will result in an update. This works reasonably well but sometimes I get an error that indicates that the update might be using cached data.
If I'm trying to update column C in Table T, with column A being the PK (Identity), the OA-generated SQL follows this sort of format:
UPDATE
T
SET
B=?, C=?
WHERE
A=?
AND
C=?
The WCF calls are ordered, so I know that they are being executed in the correct sequence. I'm using the OA Domain Model, where I query the table by PK and then make my changes before committing. The error I receive suggests that the value assigned to C in the "AND C=?" clause is actually the value that existed before the previous call, so of course the row is not found.
- Why is the "AND C=?" clause in the generated query when all I care about is updating for A? If not for that clause, this call would always work.
- Is there a way to make these calls that would be more efficient?
- Is there an alternative to my approach that would accomplish the same thing?