Hi,
I'd like to commit transaction database as soon as accessing database (especially select) is finished, but I need to access the resultant dataset afterwards. So I use CommitRetaining frequently. The real codes would look like:
SQLQuery1.Close;
SQLQuery1.SQL.Text := 'select * from table1 where cond1=:condition1';
SQLQuery1.Params[0].AsString := 'a string';
ATransaction.Active := True;
SQLQuery1.Open;
ATransaction.CommitRetaining;
with SQLQuery1 do begin
MyVar1 := FieldbyName('myvar1').AsInteger;
// ... similar operations
end;
In this case, the SQLQuery1 is left Open when the application is terminated, unless I deliberately close it. But it is a little bit cumbersome to find all datasets that might be open at later stage.
So I'm wondering whether it is save to leave it as open. In Windows application, I think there would not be a big problem. But how about if it is run in web-server in Fast CGI modules?