Hi,
I am a new user of pdDAC and I wanted to understand how to manage a pooled connection with PosrgreSQL.
Reading the documentation I tried this code below ... but I don't understand if it is using a pool or not.
This code is inserted in a REST get ... resource of my REST server.
this code is called for every GET request
thanks for any help or advice
Antonello
--- Code
var
myConn: TPgConnection;
myQuery: TPgQuery;
begin
myConn := TPgConnection.Create(nil);
myQuery := TPgQuery.Create(nil);
try
myConn.ConnectString := 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
myConn.Pooling := true;
myConn.PoolingOptions.MaxPoolSize := 100;
myConn.PoolingOptions.PoolId := 1;
myQuery.SQL.Add('select * from public.messages');
myQuery.Connection := myConn;
myConn.Connect;
myConn.StartTransaction;
myQuery.ExecSQL;
myConn.Commit;
except
on E: Exception do
Res.send(E.message);
end;
Res.send(myQuery.RecordCount.ToString);
myQuery.Close;
myQuery.Free;
myConn.Disconnect;
myConn.Free;
Manage pooling connection
Re: Manage pooling connection
Hi Antonello,
Thanks for contacting us!
Yes, you have set all parameters correctly.
You can find more information about the connection pool using the links:
https://docs.devart.com/pgdac/work_pooling.htm
https://docs.devart.com/pgdac/devart.da ... ooling.htm
An example of using the connection pool you can find in our demo:
"c:\Users\%UserName%\Documents\Devart\PgDAC for %IDEVersion%\Demos\Miscellaneous\FailOver"
where %UserName% is the username for which PgDAC is installed,
%IDEVersion% - IDE version for which PgDAC is installed
Thanks for contacting us!
Yes, you have set all parameters correctly.
You can find more information about the connection pool using the links:
https://docs.devart.com/pgdac/work_pooling.htm
https://docs.devart.com/pgdac/devart.da ... ooling.htm
An example of using the connection pool you can find in our demo:
"c:\Users\%UserName%\Documents\Devart\PgDAC for %IDEVersion%\Demos\Miscellaneous\FailOver"
where %UserName% is the username for which PgDAC is installed,
%IDEVersion% - IDE version for which PgDAC is installed