Page 1 of 1

Connection for each class instance or application?

Posted: Fri 02 Aug 2013 18:15
by yellowfever13
I appreciate this forum as it's been helpful so far, thanks in advance.

This may be a dumb question, but do I need a separate connection for each instance of a class doing queries? or a global connection for the application that they can all use?

Thanks!

Re: Connection for each class instance or application?

Posted: Mon 05 Aug 2013 12:49
by DemetrionQ
Hello.

If you have a single-thread application, you can use one connection. If you have a multi-thread, you should create a separate connection for each thread. It is enough to use one connection within a thread.