After recreating my last project (our last dialog)
In my XData service I want use Aurelius Event Handler
TMappingExplorer.Get( sys.ModelName).Events.OnInserting.Subscribe( OnInserting);
This is now global and only once.
But that's not thread safe, is it?
Do I have to use synchronize there in the procedure to keep it thread safe?
Or do I have to do it completely differently?
I use the database Aurelius database function on a request in XData
For example: (adding Date and Username on every insert)
procedure TdmDatabase.OnInserting( Args: TInsertingArgs);
begin
if Args.Entity is TsngEntity then
with Args.Entity as TsngEntity do begin
sngCreate := now;
sngCreateUser := sys.CurrentUser; // here, I take a value from a global object
end;
end;