Datasnap.DBClient.TCustomClientDataSet.SavePoint

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property SavePoint: Int64 read GetSavePoint write SetSavePoint;

C++

__property __int64 SavePoint = {read=GetSavePoint, write=SetSavePoint};

Properties

Type Visibility Source Unit Parent
property public
Datasnap.DBClient.pas
Datasnap.DBClient.hpp
Datasnap.DBClient TCustomClientDataSet

Description

Represents the current state of edits when logging changes.

Use SavePoint to save and later revert to an editing state. SavePoint is an integer that represents the current state of the change log. To use SavePoint to roll back the changes in the change log to an earlier state, set SavePoint to the value it had before the changes that should be rolled back.

Thus, when the client dataset is in a state you may want to return to, assign SavePoint to a variable:



BeforeChanges := ClientDataSet1.SavePoint;



BeforeChanges = ClientDataSet->SavePoint;



Later, to roll back all edits that were made since that point, assign the variable to SavePoint:



ClientDataSet1.SavePoint := BeforeChanges;



ClientDataSet->SavePoint = BeforeChanges;



Warning: Client datasets cannot return to a SavePoint once the change log has been backed out to a prior state. This includes undoing changes by setting SavePoint to a previously saved value, backing out too many changes using the RevertRecord method, or clearing the change log using CancelUpdates. Trying to set SavePoint to a state that is no longer available in the change log raises an exception.

See Also