0

MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) --- End of inner exception stack trace

What does this error mean? I have max connection pool =200 in the connection string? my app is web app in .net connecting mysql db.

Sharpeye500
  • 8,775
  • 25
  • 95
  • 143

1 Answers1

1

Connection pooling isn't the answer to this problem. Connection pooling allows multiple connections to be made to the server and then recycled to avoid having to reestablish the connection. Establishing and reestablishing connections can be very expensive in time and computing resources.

What you're looking for is to increase the command timeout. This can be done one of two ways. Either in the connection string by specifying default command timeout or by assigning a value to the CommandTimeout property on the MySqlCommand.

villecoder
  • 13,323
  • 2
  • 33
  • 52
  • Thanks, What is the recommended value apart from 1 ? what might trigger this to happen? – Sharpeye500 Jul 02 '11 at 00:39
  • Looks like my intial link to the connection string parameter didn't take. I've since edited it. I would recommend you start with 30 seconds for the timeout and work your way up from there. Analyze your queries to come up with an optimal time. – villecoder Jul 03 '11 at 17:12