views:

292

answers:

1

Hi.

I have C# application and I'm using MySQL database. Everything seems to be fine except one thing. Our computer network is little bit unstable. When I'm trying to execute query and the computer simultaneously loses connection to the mysql server (I'm simulating this situation by unplugging the network cable from computer which is mysql server), the program is trying to do something for long time (tens seconds). I would like to specify something like timeout which ends the query by exception or something similar. I tried to add timeout parameters to connection string but with no effect (I've used ConnectionTimeout and DefaultCommandTimeout). Is there any other way to identify lost connection after few seconds?

Thank you

Adam

P.S. Sorry for my english, I'm not native speaker.

A: 

Will setting the CommandTimeout directly on the command object not help?

Kevin Thiart
I've tried it with no effect. The command was executing for 40 seconds. :-(
Adam
If you're using MySQL Connector/NET, can you go through the same test procedure as described on this page: http://bugs.mysql.com/bug.php?id=40684, and see if you get similar results? The bug on this page has been resolved in version 6.0.5 of MySQL Connector/NET (not yet release).
Kevin Thiart