Prepared Statament
Posted: Mon 12 Dec 2016 22:57
Hi,
We're starting to work with PGBouncer in your transaction mode, that is causing various problems of prepared statament, how can I disable this feature?
I have the following implementation:
procedure TspdADOQuery.Open(const aStatement: string; aDataSet: TDataset);
begin
inherited;
if FQuery.Connection = nil then
raise EspdConnectionError.Create('Conexão não definida');
FQuery.SQL.Clear;
FQuery.SQL.Add(aStatement);
FQuery.Prepare;
FQuery.Open;
if aDataSet <> nil then
CopyRecords(aDataSet);
end;
Where FQuery is the type TPgQuery and Connection have the following configurations:
FConn.ConnectString := Format(CONNECTSTR,[Self.Password, Self.User, Self.Database, Self.Server,
Self.Port, Self.User, Self.Password]);
FConn.Pooling := True;
FConn.PoolingOptions.MinPoolSize := 10;
FConn.PoolingOptions.MaxPoolSize := 100;
FConn.PoolingOptions.ConnectionLifetime := 30000;
FConn.PoolingOptions.Validate := False;
FConn.ConnectionTimeout := 30;
Error message:
prepared statement "PRSTMTST509186724" does not exist
Thanks!
We're starting to work with PGBouncer in your transaction mode, that is causing various problems of prepared statament, how can I disable this feature?
I have the following implementation:
procedure TspdADOQuery.Open(const aStatement: string; aDataSet: TDataset);
begin
inherited;
if FQuery.Connection = nil then
raise EspdConnectionError.Create('Conexão não definida');
FQuery.SQL.Clear;
FQuery.SQL.Add(aStatement);
FQuery.Prepare;
FQuery.Open;
if aDataSet <> nil then
CopyRecords(aDataSet);
end;
Where FQuery is the type TPgQuery and Connection have the following configurations:
FConn.ConnectString := Format(CONNECTSTR,[Self.Password, Self.User, Self.Database, Self.Server,
Self.Port, Self.User, Self.Password]);
FConn.Pooling := True;
FConn.PoolingOptions.MinPoolSize := 10;
FConn.PoolingOptions.MaxPoolSize := 100;
FConn.PoolingOptions.ConnectionLifetime := 30000;
FConn.PoolingOptions.Validate := False;
FConn.ConnectionTimeout := 30;
Error message:
prepared statement "PRSTMTST509186724" does not exist
Thanks!