My program (Windows) opened two threads, each thread is a single mysql connection, a single data set, query operation for different tables;
But found that if one thread is query A table data, another thread also enter the query command (even if the query table B, need not interlock) will be submitted to the "SQL Server Error: Lost connection to MySQL Server during query" mistakes - as long as the operation database will be an Error at the same time,
But if I set my program to a single thread, running two (2), there is no any problem, even the query the same table can be
CodePudding user response:
Mysql can distinguish what is the connection thread or process? In theory it can only distinguish different connection? Then the causes of this phenomenon are the client might be the problem? Or related to drive?CodePudding user response:
Try without connection poolingCodePudding user response:
Does not use connection poolingCodePudding user response:
This depends on the program code, should not find problems on MYSQL, estimation is two threads using the same connection,