Pooling with multithreaded application ?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RH
Posts: 31
Joined: Sat 16 Sep 2006 06:32

Pooling with multithreaded application ?

Post by RH » Mon 18 Sep 2006 16:55

Hello

I have a multithreaded application, where a new TConnection instance is initialized within each new thread. I have a very simple question:

The very first thread initializes a connection, then when the thread is finished execution, it is terminated and the TConnection is freed.

If Pooling is set to TRUE, does that mean that a subsequent thread would reuse the connection initialized in the first thread ? eventhough that the TConnection instance of the first thread is freed ?

In other words: will the connection remain in the pool, even after that the TConnection that initialized it is destroyd ?

Thanks

Kind Regards

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 19 Sep 2006 12:42

Yes, connection will remain in pool even if the component that has created this connection is destroyed. It will remain in pool while ConnectionLifeTime interval exceeded or application closed.

RH
Posts: 31
Joined: Sat 16 Sep 2006 06:32

Post by RH » Tue 19 Sep 2006 18:45

Thanks alot :D

Post Reply