How to implement a ZeosLib connection pool. ZDbcPooled.pas??

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
JD
Senior Boarder
Senior Boarder
Posts: 53
Joined: 06.09.2009, 18:27

How to implement a ZeosLib connection pool. ZDbcPooled.pas??

Post by JD »

Hi there everyone,

I'm trying to implement a connection pool for an application of mine. I previously used Cary Jensen's connection pool but I later decided to write one of my own. Because I use Zeos 7.1.4 on Lazarus 1.2.6, I wrote a small class to handle connections to my database. However while debugging, I stumbled upon ZDbcPooled.pas & to my surprise it seemed to have the features I was trying to rewrite. The only problem I can't find examples of how it is used. It would be a good thing if it is made more prominent because it means it might be able to handle pooled connections to all databases that the ZeosLib supports.

So my question is this, does anyone have any examples of how ZDbcPooled.pas works?

Thanks,

JD
JD
Senior Boarder
Senior Boarder
Posts: 53
Joined: 06.09.2009, 18:27

Re: How to implement a ZeosLib connection pool. ZDbcPooled.pas??

Post by JD »

Can anybody please give me some clues? I will really appreciate it.

JD
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: How to implement a ZeosLib connection pool. ZDbcPooled.pas??

Post by marsupilami »

Hello JD,

I had a look at ZDbcPooled.pas. It seems to implement some kind of a simple caching mechanism for connections based on their DBC layer URL. It seems that this URL must be passed as the only option in the Parameters property of your TZConnection object. The background to this: Zeos drivers need to implement an interface that is derived from the JDBC specification. And in the same way as JDBC uses an URL for its drivers, Zeos does too. This URL contains all options that are set in the driver when you try to connect to the database. The options which these drivers support vary. So - your best option is to look up information about the DBC layer and understand at least its URL. Then you should go on to the driver you want to use and try to study its source code for the options it supports.

If you tell us a bit more about your project, which driver you intend to use and which options you intend to use, maybe somebody here on the forums can help you in piecing things together.

Best regards,

Jan
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: How to implement a ZeosLib connection pool. ZDbcPooled.pas??

Post by EgonHugeist »

JD,

just FYI: have to pass. Never used the component :?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply