SDAC driver, set command timeout on connection

A while ago we switched to a later version of SDAC, onyl to find out that the standard command timeout of -1 was replaced, by default, with a command timeout of 2 seconds.

This is not ideal for us, and I am looking for a clean way to specify the command time on a newly created connection.

Just to be sure this what I am doing now is the right approach??

Suggestions are appreciated
regards
Paul


In the TDAConnectionManager component I have attached the following code to the OnConnectionCreated event

procedure TdmDriverConnectionModule.DAConnectionManagerConnectionCreated(
Sender: TDAConnectionManager; const Connection: IDAConnection);
begin
InternalPrepareCommandTimeOut(Connection);
end;

procedure TdmPSPASUserconnectionCache.InternalPrepareCommandTimeOut(const
AConnection: IDAConnection);
var
connObject : IDAConnectionObjectAccess;
connectionDriver : TMSConnection;
begin
if AConnection.Connected then
begin
Exit;
end;

if Supports(AConnection, IDAConnectionObjectAccess, connObject) then
begin
connectionDriver := TMSConnection(connObject.ConnectionObject);
connectionDriver.Options.DefaultLockTimeout := -1;
AConnection.Open();
end;

end;

better to have something like

procedure TdmPSPASUserconnectionCache.InternalPrepareCommandTimeOut(const
    AConnection: IDAConnection);
var
  connObject : IDAConnectionObjectAccess;
  connectionDriver : TMSConnection;
  lmode: boolean;
begin
  if Supports(AConnection, IDAConnectionObjectAccess, connObject) then begin
     if connObject.ConnectionObject is TMSConnection then begin
        lmode := AConnection.Connected;
        if lmode then AConnection.Close;
        connectionDriver := TMSConnection(connObject.ConnectionObject);    
        connectionDriver.Options.DefaultLockTimeout := -1;
        if lmode then AConnection.Open();
     end;
  end;
end;

created connection can be already opened because OpenConnection has True by default:

function TDAConnectionManager.CreateNewConnection(const ConnectionName: string;
  OpenConnection: boolean = TRUE;
  const UserID: string = '';
  const Password: string = ''): IDAConnection;