I want to repeatedly open/close a TFDQuery without having the overhead of preparing each time but calling TFDQuery.Close automatically unprepares the query.
I have tried XE6 and Studio 10 with FireBird 3.0. I initially thought it was my configuration however after analyzing with FireDAC Monitor I found the trace as follows
Close -> Stop -> Commit -> Offline -> ReleaseBase -> DoUnprepareSource
I am unable to find any options which would leave the query prepared for un-preparing either manually or when component freed.
Query:=TFDQuery.Create(nil);
try
Query.ConnectionName:='Test';
Query.SQL.Text:='SELECT A FROM B';
Query.Prepare;
Query.Open;
Query.Close;
Query.Open; // should still be prepared but is not
finally
Query.Free;
end;