Page 1 of 1

Connection Strategy (one vs many)

Posted: Wed 08 Aug 2007 12:21
by m227
Hello.

I am developing a mid-size application using MySQL database via TCP/IP stored on company server.
I assume there will be about 2-15 simultaneous user connections with not much data stransfering. Client application has several (2-5) forms open simultaneously which one uses database (via dbgrids, or queries in source code).

My present policy is to create one connection (TMyConnection) when application starts and close it when application ends, and share that connection between open forms/queries. So one user - one connection (there will be not to much traffic and open forms will not sent data in the same time).

Is it right approach or should I create separate connection for each form and for each query and disconnect it after closing form/executing query?

What are advantages ad drawbacks of my approach? What are hints/suggestions?

Glad to use MyDAC user (registering in short time).
Michal

Posted: Wed 08 Aug 2007 14:16
by Ikar
If you use MySQL from only one thread simultaneously, then your current strategy is correct.