I've got Delphi XE Professional. It comes with a fair amount of DBX stuff, including the DBXPool
unit that contains the connection pooling support, but it doesn't have the full DBX support that comes in XE Enterprise. In particular, a lot of the design-time support isn't there.
I don't particularly mind that. I've been able to do all the stuff I've needed without it, up until I needed connection pooling. Now I'm trying to get that to work and I can't quite figure out how to make it work. I can add DBXPool
to my program and verify that it initializes, but then when I start making database requests, TDBXPoolConnection.Create
is never called.
Here's my setup code for the connection, in the BeforeConnect event handler. Anyone know what I'm doing wrong and how to get it right?
procedure TMyDataModule.connectionBeforeConnect(Sender: TObject);
begin
connection.DriverName := 'Firebird';
connection.Params.Values['User_Name'] := FUserName;
connection.Params.Values['Password'] := FPassword;
connection.Params.Values['Database'] := FDatabasePath;
connection.Params.Values['ServerCharSet'] := 'UTF8';
connection.Params.values['DelegateName'] := 'DBXPool';
connection.Params.values['DelegateConnection.MaxConnections'] := '32';
end;
EDIT: In case anyone comes across this in the future and has the same problem, here's how I had to set it up to make it work right. Instead of the last two lines above,
connection.Params.values['DelegateConnection'] := 'DBXPoolConnection';
connection.Params.values['DBXPoolConnection.DriverName'] := 'DBXPool';
connection.Params.values['DBXPoolConnection.MaxConnections'] := '32';
Thanks to Sertac for putting me on the right course!
You need to set DBXPoolConnection
to DelegateConnection
parameter.
See: Connection Pooling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With