Connection pool [SOLVED]

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
stoffman
Senior Boarder
Senior Boarder
Posts: 50
Joined: 03.12.2020, 06:55

Connection pool [SOLVED]

Post by stoffman »

Hi,

Does Zeos support connection pooling (especially on postgres, but not limited to) ? If so can someone explain how can I configure my ZConnections (running in different threads) to use the pool? thank.
Last edited by stoffman on 05.12.2020, 18:09, edited 1 time in total.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Connection pool

Post by marsupilami »

Hello stoffman,

Zeos supports using connection pools. This are a different driver though. If you want to pool your connection, use "pooled.postgres". Connections will be pooled from there.
But the base principle for threads in Zeos still applies there: one conenction may only be used in one thread at the same time. Zeos is not thread safe beyond that.

Best regards,

Jan
stoffman
Senior Boarder
Senior Boarder
Posts: 50
Joined: 03.12.2020, 06:55

Re: Connection pool

Post by stoffman »

Hi Jan,

I'm not sure what you mean by use "pooled.postgers" (I'm really new to zeos)

The only thing that resemble your suggestion is the protocol property in ZConnection that has: "pooled.*" value
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 797
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Connection pool

Post by aehimself »

"pooled." is a prefix, not a standalone protocol. If you need a pooled connection of "mysql" protocols, enter "pooled.mysql"; if you need "oracle", enter "pooled.oracle" and so on.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
stoffman
Senior Boarder
Senior Boarder
Posts: 50
Joined: 03.12.2020, 06:55

Re: Connection pool

Post by stoffman »

Thanks.
Post Reply