DBConnection.Disconnect

Hi,
In the below procedure do I need to call DBConnection.Disconnect inside the finally section?
I know it is an interface so I don't need to free it but I could not be sure if it must be disconnected after such use.
Thanks in advance

procedure ProcessVideoFile;
var
  DBConnection: IDBConnection;
  Manager: TObjectManager;
begin
  Manager := nil;
  try
    DBConnection := TranscriberServerModule.AureliusConnection.CreateConnection;
    Manager := TObjectManager.Create(DBConnection);
    //....
  finally
    Manager.Free;
  end;
end;

In short, no. It will disconnect automatically.

Strictly speaking, it's really up to the underlying component you are using for the database connection. When the interface is destroyed, the component is destroyed (say, TFDConnection). Aurelius supports several database components, and if I'm not wrong, all of them perform a disconnect when destroyed. But that's up to the component.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.