我有一个Midas项目,它在服务器中的一个TDataSetProvider中使用RemoteDataModules
目前,我正在利用下列事件
问题:
即使是更新错误,‘AfterApplyUpdates’也总是被调用吗?
发布于 2009-01-07 20:40:14
如果您查看源代码:
function TCustomProvider.DoApplyUpdates(const Delta: OleVariant; MaxErrors: Integer;
out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant;
begin
SetActiveUpdateException(nil);
try
try
if Assigned(FOnValidate) then
FOnValidate(Delta);
DoBeforeApplyUpdates(OwnerData);
Self.OwnerData := OwnerData;
try
Result := InternalApplyUpdates(Delta, MaxErrors, ErrorCount);
finally
OwnerData := Self.OwnerData;
Self.OwnerData := unassigned;
end;
except
on E: Exception do
begin
SetActiveUpdateException(E);
raise;
end;
end;
finally
try
DoAfterApplyUpdates(OwnerData);
finally
SetActiveUpdateException(nil);
end;
end;
end;Yoy看到在finally块中调用了DoAfterApplyUpdates。这意味着它总是被称为关注任何异常。
https://stackoverflow.com/questions/421934
复制相似问题