RCorrectly refresh record after insert/update

icegood

Member²
Hi, Marco!

I want to share my experience of usage of TOracleDataSet.
In documentation we can find smth. like :

Refresh the record. Note that you don't actually need this action to refresh a record after
an insert or update, because you can simply update the value of the fields during the
Insert and Delete (should be Update there?) action.

but in practice it is not true. The problem is when i simply update records in OnApplyRecord during I/U actions it writes values to different buffer because TOracleDataSet.Applying = TRUE. Once Applying become FALSE in TOracleDataSet.ApplyUpdates i obtain old data and as consequence i could suffer of 'Record has been changed' error later since record is not synced with DB in right way. All i can do is to set
RefreshOptions to both roAfterInsert/roAfterUpdate and seems in this way right buffer is updated.
 
Seems, i understand how to workaround such a behavior. It is crucial to update fields via NewValue property there.
 
Back
Top