Page 1 of 1

How to use connection pooling in multi threaded apps

Posted: Mon 19 Oct 2009 16:01
by Realtime
Hello

I have an application with a webserver and different database events, resulting in database access in different threads.
I find some reference info about connection pooling, and that I have to use one connection per thread. But I do not understand the interactions!

Is there an exaple for setting up and using a connection with connection pooling in a new thread?

Many thanks for any help and hint!

Posted: Tue 20 Oct 2009 08:16
by Plash
In your thread create a TIBCConnection component. Set the Pooling property of TIBCConnection to True. When you call the Connect method the TIBCConnection component will automatically use the connection pool.

Posted: Mon 01 Mar 2010 16:28
by imeyer
Plash wrote:In your thread create a TIBCConnection component. Set the Pooling property of TIBCConnection to True. When you call the Connect method the TIBCConnection component will automatically use the connection pool.
How can i do this ? if i create the TIBConnection in my Threade should this be an the execute part of it or in the thread create methode and what about the end of the thread could i destroy the created object or how i have to handle this

An Example in delphi would bee very usefull

thanks in advanced

Posted: Thu 04 Mar 2010 08:17
by Dimon
Pooling is thread safe, therefore you can create TIBConnection directly in your thread in the same way as in the single-threaded application.