uaSkip & OldValue

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

uaSkip & OldValue

Post by Ludek » Mon 04 May 2015 14:05

Hi devart,
i'm currently experiencing following problem:
TMSQuery in cached updates mode, some cached changes. now i need to apply the changes in special order (because of some db logic), first inserts, then updates.
So i use the uaSkip updateaction in updaterecord event for the records, that i need to update in the second phase. But in the second phase, the ".oldvalue" property of query fields already returns the new value, so I don't have enough infos to perform my update...
Is there some way to have the REAL old value in the .oldvalue property?
Thanks, Ludek.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: uaSkip & OldValue

Post by azyk » Fri 08 May 2015 12:00

You can apply updates firstly for inserted records, then for modified. For example:

Code: Select all

// first phase
MSQuery.ApplyUpdates([ukInsert]);
...
// second phase
MSQuery.ApplyUpdates([ukUpdate]);
See more details about the ApplyUpdates methods in our documentation:
http://www.devart.com/sdac/docs/#devart ... kinds).htm

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Thu 15 Dec 2016 08:18

That does not help me. For sdac, all the changes are ukModify. Only internally, in OnUpdateRecord, i generate inserts, updates, deletes (background: the tmsquery contains a left outer join, user just changes data in dbgrid, but i internally do deletes for the records being emptied, inserts for records changed from null to some not null value and updates for changing on not null value to other not null value).
So the question remains: how can I see the "real" oldvalue in onupdaterecord handler in the second run, when the first one ended with uaSkip (because that time it was not yet possible to save them because of some unique constraint and the f*cking sql server not knowing feature called deferred updates...)

Thank you for some tip!
Ludek.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Thu 15 Dec 2016 08:24

btw. I even tried to use uaRetry, but it does retry immediately. I need to retry it after updates of the other unsaved records...

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: uaSkip & OldValue

Post by azyk » Tue 20 Dec 2016 10:50

We are trying to change this behavior and will inform you about the results.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Tue 20 Dec 2016 13:46

Thank you!

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Tue 03 Jan 2017 10:01

Hi, are there any news?

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: uaSkip & OldValue

Post by azyk » Wed 04 Jan 2017 10:13

This change will be included in the next SDAC build.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Wed 25 Jan 2017 06:35

Do you have an estimation of availability of the "next build"?
Thanks, Ludek.

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: uaSkip & OldValue

Post by azyk » Fri 27 Jan 2017 09:27

SDAC release is planned in a month.

If you want to get this change before the next SDAC release, please send your license number to andreyz*devart*com and we will send you a night build.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Mon 06 Mar 2017 08:17

hi, much more than a month passed, no new version available ... :x

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Re: uaSkip & OldValue

Post by Ludek » Tue 04 Apr 2017 12:59

It is really sursprisingly long month from jan 27 to apr 04... and there is still no version. :evil:

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: uaSkip & OldValue

Post by azyk » Thu 06 Apr 2017 09:27

New SDAC 8.0.1 version is available for download.

Post Reply