A multitude of connection issues

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Desperado
Posts: 8
Joined: Mon 08 Nov 2004 08:05
Location: Norway

A multitude of connection issues

Post by Desperado » Mon 08 Jun 2009 11:32

After deploying a web project we suddenly started having serious issues with connections to one of the databases on our server.

We connect to two databases; the one with the most traffic seems to work fine.

On the other however, the log fills up with errors like:

(1130 occurences)
Type : Devart.Data.MySql.MySqlException, Devart.Data.MySql, Version=5.0.22.0, Culture=neutral, PublicKeyToken=09af7300eec23701
Message : Net packets out of order: received[1], expected[21]

(540 occurences)
Type : Devart.Data.MySql.MySqlException, Devart.Data.MySql, Version=5.0.22.0, Culture=neutral, PublicKeyToken=09af7300eec23701
Message : Lost connection to MySQL server during query

(2300 occurences)
Type : System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Connection must be opened.

We use connection pooling. The queries are not very complex, usually selects matching on an ID or a search string with some joins to other (rather small) tables.

Any pointers to how i can find out what is going on? This is running under IIS 7; sites using the same data access under IIS 6 seem unaffected.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 09 Jun 2009 14:06

1. Please make sure, that the connection object is not used in several threads simultaneously.
2. Try to assign the greater value to the MySqlCommand.CommandTimeout property (by default, it is 30 seconds) or set it to 0.
3. Could you please provide us with a small test project to reproduce the problem? Please send us your DDL and DML script and tell us the MySQL server version.

Desperado
Posts: 8
Joined: Mon 08 Nov 2004 08:05
Location: Norway

Post by Desperado » Wed 10 Jun 2009 07:52

Thanks for the hints.

After examining our code more closely, it was discovered that the data access classes were being used in a static way - meaning all queries were piped through the same connection.

Edited the code so it now instantiates a new data access classes for each page request, and now it works like a dream.

Consider the case closed. :)

Post Reply