Reputation: 3482
I am currently modifying my C# application and was thinking of following this for the MySQL part of it:
I few doubts I was having in regards this were:
Will a single connection allow me to run simultaneous queries/commands (weird question I know, I haven't hit a simultaneous connection yet and am not sure how to test it) ?
I was initially thinking of using connection pooling but since I may have some queries that would take some time to finish, I opted for not, so I can keep sending commands and get their reply while the connection is open, is that OK ?
If instead of using the above sequence I simple open and close connections per command, it could happen that the application hits the max connection limit of that MySQL user is that correct ? if I am not mistaken there is a cap to 100 connections.
Upvotes: 0
Views: 991
Reputation: 76537
Will a single connection allow me to run simultaneous queries/commands
No.
I was initially thinking of using connection pooling but since I may have some queries that would take some time to finish, I opted for not, so I can keep sending commands and get their reply while the connection is open, is that OK ?
Yes, that's perfectly OK, keep an eye out for locks, if you are also doing updates though.
If instead of using the above sequence I simple open and close connections per command, it could happen that the application hits the max connection limit of that MySQL user is that correct ? if I am not mistaken there is a cap to 100 connections.
Actually its 151, but you can change this values if needed.
See: http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html
Upvotes: 1