Hi Everyone,
I have a quick question on the CachedUpdates property that can be set to true on a Query.
What does this property do?
Does it:
1) Cache any updates made to the dataset and does not write the changes to records to disk until ApplyUpdates is called. This means all changes / updates to data in the dataset is cached until ApplyUpdates is called and the updated will remain in memory until this is done.
2) Therefor, does this mean when I insert a new record into a dataset, I have to call ApplyUpdates in order for this record to be stored? (I have found that when not doing this, the new data is not always stored).
Thanks in advance!
Query.CachedUpdates
Moderators: gto, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
This property means that communication with the server only happens 'on demand'. Not sure, but I believe closing a dataset also does this.
Normally only changing this option should not have any effect on final data in the database (not taking into account the influence of other sessions on the database).
Concerning
Mark
Normally only changing this option should not have any effect on final data in the database (not taking into account the influence of other sessions on the database).
Concerning
This may be bad behaviour (~ a bug). Difficult to tell with only the data above.(I have found that when not doing this, the new data is not always stored)
Mark
I don't thing its a bug, more like feature.
It seems that CachedUpdates resembles behavior of delphi T(BDE|IBX)* components and influences how UpdateObject will work (if assigned).
If CachedUpdates := false then updates will be immediately applied (query will be executed).
If CachedUpdates := true, all updates (chages) will be, well.. cached - not applied to dataset until ApplyUpdates called. This behavior allows to change many records at once, and, in theory, to work "offline". I never tested zeos implementation in details but I think it works...
It seems that CachedUpdates resembles behavior of delphi T(BDE|IBX)* components and influences how UpdateObject will work (if assigned).
If CachedUpdates := false then updates will be immediately applied (query will be executed).
If CachedUpdates := true, all updates (chages) will be, well.. cached - not applied to dataset until ApplyUpdates called. This behavior allows to change many records at once, and, in theory, to work "offline". I never tested zeos implementation in details but I think it works...