Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How To Use Connection Pooling With A Multi-threaded Environment In Delphi

This sample implements a multithreaded application, where each thread uses the IFDPhysConnection interface to establish a connection. The multiple connection establishments may lead to performance degradation across the whole system. To avoid this, you can enable the Pooled property to use the connection pooling.

Location

You can find the Pooling sample project at:

How to Use the Sample

  1. Navigate to the location given above and open IFDPhys_Pooling.dproj.
  2. Press F9 or choose Run > Run.
  3. Interact with the sample:
    1. Select an option from the Use Connection Definition combo box.
    2. Click the Run button and see the execution time.
    3. Select the Run Pooled check box, click the Run button and see the execution time.
    4. Compare both execution times.

Files

File in DelphiContains
IFDPhys_Pooling.dproj
IFDPhys_Pooling.dpr
The project itself.
fPooling.pas
fPooling.fmx
The main form.

Implementation

When you run the application, you can interact with the sample using the following objects:

Through the link below you can visit the original post about this sample:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.IFDPhysConnection.Pooling_Sample

Exit mobile version