All dataset class components are inherited from Tmemdataset, which implements the management of data in memory, with its main properties, methods, and events as follows.
1. Data Update
Name |
Type |
Description |
Cachedupdates |
Boolean |
Whether the data set uses buffered mode |
Applyupdates |
|
Commits uncommitted data in the buffer to the database, but does not perform transactional operations on the database. The buffer data still exists and the UpdateStatus state is modified, calling Commitupdates to clear the cached data and revert the state to a non-modified state. Applyupdates is not placed in the try exception block, if there is a data update failure, the exception information prompt will be triggered, and if updateaction is not set to Uaabort in Onupdateerror, the error message prompt will be triggered again. |
Cancelupdates |
|
Discard changes to uncommitted data in the buffer to restore the original state |
Restoreupdates |
|
Restores all buffer data in the dataset to the update state prior to the call to Applyupdates, with a version used when the update failed |
Commitupdates |
|
Clears uncommitted data from the buffer, but changes skipped through Onupdaterecord or Onupdateerror events are not cleared |
Updatespending |
Boolean |
Determines whether the buffer has uncommitted data, true indicates that there is |
UpdateStatus |
Tupdatestatus |
Returns the update status of the dataset under the current record. |
Updateresult |
Tupdateaction |
Returns the execution state of the data set after the call to the Applyupdates method in that record |
Updaterecordtypes |
|
Returns the update mode of the current record in buffered mode |
Localupdate |
Boolean |
Whether the update is local or True will prevent the dataset from automatically submitting the data to the server, but rather buffering it in local memory. |
Deferredpost |
|
Unlike post, Deferredpost permanently saves the modified commit database that has been completed, while the dataset state remains in edit or new (DsEdit, Dsinsert), and calling the Cancel function does not cancel the modified content of the committed database. Use on the need to be cautious |
revertrecord |
" font-size:14px "> " |
in buffered mode, undo data updates to the current record |
onupdaterecord |
  |
triggers when a record is updated, and if it is in buffered mode, the event is triggered after applyupdates. The updateaction default for the event is uafail, which needs to be set to uaapplied if the code operation succeeds. The values are as follows: uafail trigger failure exception information uaabort interrupts subsequent updates and rolls back uaskip Skip, but do not error uaretry Try again, it is easy to form a dead loop uaapplied code has been processed and ODAC is no longer automatically processed |
Onupdateerror |
|
Triggered when a data update has an error, and if it is in buffered mode, the event is triggered after applyupdates. The updateaction of the event defaults to Uafail, By accessing the event arguments DataSet's Fields Tfield.oldvalue and Tfield.newvalue get the original value and the new value, setting the updateaction of the event to Uaretry can retry the update. Applyupdates is not placed in the try exception block, the exception information prompt will be triggered, and if updateaction is not set to Uaabort in Onupdateerror, the error message prompt will be triggered again. |
ODAC (V9.5.15) study notes (iv) Tmemdataset (1)