opened connection by an exception

opened connection by an exception

In the TCustomPgDataSet.Execute(PgAccess) becomes TCRConnection.FAutoCommit(CRAccess) set to false and not reset after the exception in the RefreshRecord.

Then the error dialog, through our THauptForm.ShowServerTimer a ConnectionCheck with "Select true," starts in the TPgSQLCommand.Execute(PgClasses) a transaction, because still Connection.AutoCommit on false and then it provokes exceptions everywhere:

EPgError: "current transaction is aborted, commands ignored until end of transaction block"

Bugfix proposal:

procedure TCustomPgDataSet.Execute;
var
  AutoCommitChanged: boolean;
begin
  AutoCommitChanged := ChangeAutocommit;
  try
    inherited Execute;
  finally
    if AutoCommitChanged then
      Connection.AutoCommit := True;
  end;
end;

procedure TCustomPgDataSet.Execute(Iters, Offset: integer);
...
//similarity