How to configure DBX connection pool in code?

I have Delphi XE Professional. It comes with enough DBX materials, including the DBXPool block, which supports pooling support, but it does not have the full DBX support that comes with XE Enterprise. In particular, a lot of development-time support does not exist.

I don’t particularly like it. I was able to do everything I needed without it until I needed a connection pool. Now I'm trying to get this to work, and I can't figure out how to get it to work. I can add DBXPool to my program and make sure it is initialized, but then when I start making database queries, TDBXPoolConnection.Create never called.

Here is my setup code for the connection, in the BeforeConnect event handler. Does anyone know what I'm doing wrong, and how to do 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 someone encounters this in the future and has the same problem, here is how I had to configure it to work correctly. Instead of the last two lines,

 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 track!

+7
source share
1 answer

You need to set the DBXPoolConnection parameter to DelegateConnection .

See: Connection Pool .

+4
source