Connection for each class instance or application?

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
yellowfever13
Posts: 4
Joined: Wed 24 Jul 2013 16:17

Connection for each class instance or application?

Post by yellowfever13 » Fri 02 Aug 2013 18:15

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!

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Connection for each class instance or application?

Post by DemetrionQ » Mon 05 Aug 2013 12:49

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.

Post Reply