Problem with SQlUpdate

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 12
Joined: Wed 13 Feb 2008 03:53

Problem with SQlUpdate

Post by MNosouhi » Wed 13 Feb 2008 04:25

I Change "CheckRowVersin" and "DMLRefresh" of MSQuery to "True" to have a Pessimistic lock (if 2 user try to edit one record , the first user could save changs,but second user recive error message "Update Failed : 0 record Found").
Pessimistic Lock work correctly while "SQlUpdate" do not has value. (if "SQLUpdate" has value , Pessimistic Lock do not work and second User do not recive error message).
is it a bug in sdac?

i use SDAC ver 4.35 and delphi7&Delphi2007 and windows xp with sql2005

Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 13 Feb 2008 09:29

CheckRowVersion and DMLRefresh options affect autogenerated update SQL statements only. To perform optimistic record locking you should include all fields, to make sure they were not changed. If you want to use a rowversion field, you should remember that its value is changed after update, and you should refresh it in the dataset.

Post Reply