public override int Save()
{
//...
foreach (var dataSet in AllChildDataSets)
{
dataSet.SetEditCheckpoint();
}
int ret = BookRM(commit: false);
try
{
foreach (var dataSet in AllChildDataSets)
{
dataSet.CommitEditCheckpoint();
}
}
catch (Exception ex)
{
foreach (var dataSet in AllChildDataSets)
{
dataSet.RevertEditCheckpoint();
}
LoggerSink.PushMessage(this, l.Translate(ex.Message), Severity.Exception);
}
return ret;
}
dataSet.SetEditCheckpoint() is used for prevent the possibility that an exception to be thrown. In that case, if SetEditCheckpoint() is not used, the DataBase will return to its previous state, but the DataSet will not.
In conclusion, SetEditCheckpoint() is used for rollbacks to be done on DataSets as well.