I have specified command_timeout for 4 seconds.
But when I run the application, the command takes something about 8-12 seconds before it times out.
I also specified connection timeout in MySQL connection string, but with no luck
default command timeout=4
It works for MsSqll and Oracle well, but for MySQL not.
Is there any way how to specify the timeout?
I found the issue there https://forums.mysql.com/read.php?38,634568,634568 but with no answer.
Edit
Code Sample
...
DataTable outputNodes = new DataTable();
Stopwatch sw = new Stopwatch();
cmd.CommandTimeout = 4;
sw.Start();
var a = cmd.ExecuteReader();
sw.Stop();
ex_time = sw.Elapsed;
sw.Reset();
outputNodes.Load(a);
CloseConnection();
...
MySqlCommand cmd = new MySqlCommand(); cmd.CommandTimeout = 4;