Hello,
Is it possible to use UniDAC in multi-threaded applications?
I work on a project that is an Application Server, and has threads to handle requests, and each thread has its own connections (TFDConnection's), TFDQuery's and TFDTable's, under this scenario or multi-threaded architecture, does UniDAC work?
Thanks in advance.
UniDAC in an Application Server (multi-thread)
-
- Posts: 29
- Joined: Mon 10 Dec 2018 23:49
Re: UniDAC in an Application Server (multi-thread)
To ensure thread safety in multi-threaded UniDAC applications, you should use a separate TUniConnection instance for each thread.
Thus, all you need to do is to replace TFDConnection's, TFDQuery's and TFDTable's with similar UniDAC components.
Thus, all you need to do is to replace TFDConnection's, TFDQuery's and TFDTable's with similar UniDAC components.
-
- Posts: 29
- Joined: Mon 10 Dec 2018 23:49
Re: UniDAC in an Application Server (multi-thread)
Perfect, thank you very much.
Re: UniDAC in an Application Server (multi-thread)
i have similar problem,
i use omniThreadLibrary for the thread. and in the process i need to connect the database to check the qty stock.
after running sometime, creating connection failed, it said max connection reached in the pool.
i set max 200 and min 2. lifetime just 5.
in this forum, i check that i must set the pooling to true. and every single thread must have seperate connection to database, right?
how to programming unidac with thread in right coding? i am lost here... please help
some example will be nice
i use omniThreadLibrary for the thread. and in the process i need to connect the database to check the qty stock.
after running sometime, creating connection failed, it said max connection reached in the pool.
i set max 200 and min 2. lifetime just 5.
in this forum, i check that i must set the pooling to true. and every single thread must have seperate connection to database, right?
how to programming unidac with thread in right coding? i am lost here... please help
some example will be nice
Re: UniDAC in an Application Server (multi-thread)
As indicated earlier, each single thread must have a separate TUniConnection instance when you develop multuthread applications with UniDAC. If you are you getting the error when the Pooling property is set to False, please compose and send us a code sample that would allows us to reproduce the issue in our environment. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html