Bug #58316 | Error reopening connection after MySql restart | ||
---|---|---|---|
Submitted: | 19 Nov 2010 8:53 | Modified: | 2 Jun 2011 18:20 |
Reporter: | Barbara Post | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.3.5 | OS: | Windows |
Assigned to: | Julio Casal | CPU Architecture: | Any |
[19 Nov 2010 8:53]
Barbara Post
[19 Nov 2010 11:13]
Barbara Post
I checked that the proposed fix for 6.2.2 version is valid for 6.3.5 version too.
[19 Nov 2010 11:58]
Tonci Grgin
Hi Barbara and thanks for your report. I gather from the patch (as there is no test case attached) that you are using pooling. If so, this is weird. Please do submit small but *complete* test case along with IIS settings so I can check.
[21 Nov 2010 22:24]
Barbara Post
Yes I use pooling. I will provide you the required info and sample within a few days at worst.
[23 Nov 2010 12:38]
Barbara Post
Test case : console app to run + script to create testdb DB
Attachment: BugReport58316.zip (application/empty, text), 153.98 KiB.
[23 Nov 2010 12:42]
Barbara Post
Hello, I just uploaded a console application (VS 2010 solution but I uploaded the executable in bin\Debug folder as well as the connector dll so you can run it as is). Just create the "testdb" database first using the provided sql script (along the cs code). After launching the program, it writes to its console and VS console. When it asks to restart MySql, I use Windows services to do so. Then it crashes when reopening the connection after it dealt with MySqlException. I don't have any special setting, even not pooling in connection string (neither in my app). Is this sufficient ? Regards, Barbara
[25 Dec 2010 21:36]
Pavel Bazanov
Hello, I think that maybe I have a similar issue. First, a connection is broken (I don't know why, will be thankful for any hints of possible reasons) and here what logs say: ------------------------------------------------------------ [12.12.2010 17:31:24] Computer name / User name: ASUS / MetalHeart Exception type: MySql.Data.MySqlClient.MySqlException Action: Preparing and executing SQL-statement to show orders Exception message: Fatal error encountered during command execution. Exception type: MySql.Data.MySqlClient.MySqlException Exception message: Fatal error encountered attempting to read the resultset. Exception type: MySql.Data.MySqlClient.MySqlException Exception message: Reading from the stream has failed. Exception type: System.IO.IOException Exception message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Exception type: System.Net.Sockets.SocketException Exception message: An existing connection was forcibly closed by the remote host Stack trace: at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at ... some higher level methods After the exception the user tries to repeat the operation and gets a NullReferenceException: ------------------------------------------------------------ [12.12.2010 17:31:27] Computer name / User name: ASUS / MetalHeart Exception type: System.NullReferenceException Action: Preparing and executing SQL-statement to show orders Exception message: Object reference not set to an instance of an object. Stack trace: at MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute) at MySql.Data.MySqlClient.NativeDriver.SetDatabase(String dbName) at MySql.Data.MySqlClient.Driver.SetDatabase(String dbName) at MySql.Data.MySqlClient.MySqlConnection.ChangeDatabase(String databaseName) at MySql.Data.MySqlClient.MySqlConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at ... some higher level methods Do you think it's the same issue? I would go digging deeper myself, but currently I'm breaking the deadline and running out of time :(
[2 Jun 2011 18:20]
Julio Casal
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. Fixed versions: 6.1.6, 6.2.5, 6.3.7, 6.4.1+. If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at http://dev.mysql.com/doc/en/installing-source.html