7

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!

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
  • Is it possible that while the unit ships with XE pro, it isn't functional (because the DBX libraries/dlls don't enable this feature in this SKU?) – Warren P Apr 18 '12 at 22:41
  • I've never done antying similar but from what I'v read I recall a "DelegateConnection" parameter. [Here](http://docwiki.embarcadero.com/RADStudio/en/Connection_Pooling_%28Delegate_Drivers_tutorial%29) it says it must be assigned 'DBXPoolConnection'. – Sertac Akyuz Apr 18 '12 at 22:51
  • @Sertac: Aha! That's what I was missing. I'd read that, but I wasn't quite sure what parts applied to where. I've got it working now. Thanks! If you post that as an answer, I'll accept it. – Mason Wheeler Apr 18 '12 at 23:13
  • @Mason what Firebird driver are you using? I was under the impression that the DBX driver for Firebird wasn't supported in the Professional version... You had to get the Enterprise or higer for that driver. – Michael Riley - AKA Gunny Jul 04 '12 at 14:28
  • @CapeCodGunny: The driver produced by Chau Chee Yang. – Mason Wheeler Jul 04 '12 at 14:36

1 Answers1

4

You need to set DBXPoolConnection to DelegateConnection parameter.

See: Connection Pooling.

Sertac Akyuz
  • 54,131
  • 4
  • 102
  • 169