SQL generated sequence When TUniQuery Applyupdate

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cxg417
Posts: 41
Joined: Thu 26 Mar 2009 08:07

SQL generated sequence When TUniQuery Applyupdate

Post by cxg417 » Wed 08 Apr 2009 02:04

Use TUniQuery to Open a Table
For example
FieldName: ID Name Password
FielValue: ?001 John 11
???????002 Rose 112
???????003 Bush 333
???????004 Ben 3433
???????005 Smith 211

First,modify Password of ID='003', and then modify Password of ID='005', and then modify Password of ID='002'

I note that the order of the generated SQL statement is as follows

Update Table Set Password='121' Where ID='003'

Update Table Set Password='121' Where ID='005'

Update Table Set Password='121' Where ID='002'

This will create a problem, When multiple user modify this table, Different users, Edit the order of different,The resulting sequence of SQL statements may be cross. May have deadlock

How to make the SQL statement generated sequence and the order form the Table keywords.
________
WEED BUBBLERS
Last edited by cxg417 on Thu 10 Mar 2011 10:56, edited 1 time in total.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 08 Apr 2009 08:15

UniDAC does not have any features to order update statements.

When executing ApplyUpdates, if you set the LockMode property to lmOptimistic, UniDAC locks only one record at a time. So deadlock should not occur.

Post Reply