I know the correct way to multithread with UniDAC is to create a new TUniConnection for each thread. The problem is that some DB have simultaneous connection limit values low. I'm using AWS redshift (through ODBC) and they have a limit of 500 connections, which is very low for a high demand platform, if you need to deploy 10 queries at once for a simple request.
My question is:
Is there a way to share the same TUniConnection object inside multiple threads that need "read-only" access to the same DB (simple sql selects)? Any specific option that might help?
Multithreading and connection count limits
-
- Posts: 18
- Joined: Mon 11 Apr 2011 15:28
Re: Multithreading and connection count limits
You can try to use one TUniConnection in case if your ODBC driver supports a multithreaded access. Otherwise, you need to create a new TUniConnection for each thread.