Subject RE: [IBO] Re: Field trimming
Author Jason Wharton
> Oops... here is the code for CreateDSQL:
>
> function TDataModuleName.CreateDSQL(aTx: TIB_Transaction; const aSQL:
> String): TIB_DSQL;
> begin
> result := TIB_DSQL.Create(nil);
> result.IB_Connection := FIBConn;
> result.IB_Transaction := aTx;
> result.SQL.Text := aSQL;
> end;

Please avoid using a NILL owner in constructors.

See below for how it should be done:

function TDataModuleName.CreateDSQL(
aTx: TIB_Transaction; const aSQL: String): TIB_DSQL;
begin
result := TIB_DSQL.Create( FIBConn );
result.IB_Connection := FIBConn;
result.IB_Transaction := aTx;
result.SQL.Text := aSQL;
end;


Using a nil owner causes all objects to use the default session and so if
you are using multi-threading this could become problematic.

Jason Wharton