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;
Search found 1 match
Search found 1 match
• Page 1 of 1
- by wau73
- Thu 28 Jul 2022 14:11
- Forum: PostgreSQL Data Access Components
- Topic: Manage pooling connection
- Replies: 1
- Views: 8066
Search found 1 match
• Page 1 of 1
Jump to
- General Forums
- ↳ Announcements
- Database Tools
- ↳ dbForge for MySQL
- ↳ dbForge for Oracle
- ↳ dbForge for PostgreSQL
- ↳ dbForge for SQL Server
- ADO.NET Data Providers
- ↳ Entity Framework support
- ↳ LinqConnect (LINQ to SQL support)
- ↳ dotConnect for Oracle
- ↳ dotConnect for MySQL
- ↳ dotConnect for PostgreSQL
- ↳ dotConnect for SQLite
- ↳ dotConnect for DB2
- ↳ dotConnect for SQL Server
- ↳ dotConnect for Cloud Applications
- ↳ dotConnect Universal
- ↳ Entity Developer
- Delphi Data Access Components
- ↳ EntityDAC
- ↳ Universal Data Access Components
- ↳ Oracle Data Access Components
- ↳ SQL Server Data Access Components
- ↳ MySQL Data Access Components
- ↳ InterBase Data Access Components
- ↳ PostgreSQL Data Access Components
- ↳ SQLite Data Access Components
- ↳ VirtualDAC
- dbExpress Drivers
- ↳ dbExpress driver for Oracle
- ↳ dbExpress driver for SQL Server
- ↳ dbExpress driver for MySQL
- ↳ dbExpress driver for InterBase & Firebird
- ↳ dbExpress driver for PostgreSQL
- ↳ dbExpress driver for SQLite
- ODBC Drivers
- ↳ ODBC Drivers
- Network Security
- ↳ SecureBridge
- Developer Tools
- ↳ Code Compare
- ↳ Review Assistant
- ↳ LINQ Insight
- ↳ SSIS Data Flow Components
- ↳ Excel Add-ins