Read less bytes than expected.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
ed.sh.5505
Posts: 1
Joined: Tue 30 Aug 2011 16:09

Read less bytes than expected.

Post by ed.sh.5505 » Tue 30 Aug 2011 16:20

Retrieving large data sets intermittently returns an error Read less bytes than expected due to a lost connection. Is there any tuning which should be done when working with large data sets and dotConnect for MySQL.

Here are the exception details

Read less bytes than expected.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more

information about the error and where it originated in the code.

Exception Details: Devart.Common.s: Read less bytes than expected.

Stack Trace:

[s: Read less bytes than expected.]
Devart.Common.e.c(Byte[] A_0, Int32 A_1, Int32 A_2) +369
Devart.Common.u.e(Byte[] A_0, Int32 A_1, Int32 A_2) +66

[MySqlException (0x80004005): Lost connection to MySQL server during query]
Base.MySQL.ExecuteQuery(String commandText, ParamList parameters, Boolean isProcedure) in DataAccessBase.cs:188
Base.MySQL.ExecuteQuery(String commandText, ParamList parameters) in DataAccessBase.cs:152
DataAccess.GetAllMySql() in \App_Test\MySqlTest.aspx.cs:60
App_Test_MySqlTest.Page_Load(Object sender, EventArgs e) in \App_Test\MySqlTest.aspx.cs:25
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

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

Post by Shalex » Thu 01 Sep 2011 12:47

1. Please try setting the "Default Command Timeout=0;" connection string parameter.
2. Have you tried the latest (6.30.202) version of dotConnect for MySQL?

If this doesn't help, send us a small test project with the corresponding DDL/DML script to reproduce the issue in our environment.

pnatov
Posts: 2
Joined: Wed 06 Aug 2014 04:46

Re: Read less bytes than expected.

Post by pnatov » Tue 14 Jul 2015 07:13

We are still experiencing this error. In the past it appeared from time to time - once in a week. Now with the increase of the resutlsets beeing retrieved via the dotConnect drive we see the error most of the time.

We use the dotConnect drive in combination with SSMS 2014 to populate SSAS database.

Driver version : 8.3.215.0

During SSAS database processing we see the following error 9 out of 10 times


Errors in the high-level relational engine. The following exception occurred while the managed IDataReader interface was being used: Lost connection to MySQL server during query;Read less bytes than expected..



I've tried setting the "Default Command Timeout=0;" but it did not help.
Any ideas or suggestions how to solve this ?

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

Re: Read less bytes than expected.

Post by Shalex » Fri 17 Jul 2015 11:02

pnatov,

Try using the new (8.3.457) build of dotConnect for MySQL.

If this doesn't fix the issue, please give us the following information:
1) are you getting exactly the same call stack of the error like the one written by ed.sh.5505 in this thread? Specify yours
2) the exact version of your MySQL Server
3) can you reproduce the problem with a simple ADO.NET code (http://www.devart.com/dotconnect/mysql/ ... eader.html)?
4) send us a small test project with the corresponding DDL/DML script for reproducing. Also specify the steps we should follow

tedkrapf
Posts: 1
Joined: Mon 26 Oct 2015 21:55

Re: Read less bytes than expected.

Post by tedkrapf » Mon 26 Oct 2015 21:58

@ed.sh.5505 or anyone else..

I'm getting the same error message using the latest version of dotConnect, it's intermittent and we cannot find any errors from MySQL, the servers in general or otherwise to help pinpoint what's going on :(

Thoughts?
TIA!

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

Re: Read less bytes than expected.

Post by Shalex » Tue 27 Oct 2015 08:14

Please review your code. Are you using the same connection object in multiple threads?

The MySqlConnection instance is not guaranteed to be thread safe. You should avoid using the same MySqlConnection in several threads at the same time. It is recommended to open a new connection per thread and to close it when the work is done. Actually, connections will not be created/disposed every time with the Pooling=true; connection string option - connections will be stored at connection pool. This boosts performance greatly.

Post Reply