This is a migrated thread and some comments may be shown as answers.

Error: Attempted to read past of the stream

1 Answer 67 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sandro
Top achievements
Rank 1
Sandro asked on 16 Sep 2014, 07:17 PM
Hi,

I'm developing a web application using a third party API (Visual Web Gui) and OpenAccess for the Database. The database I'm using is MySQL.

I have a connection for each thread I use. If the website remains open for a period of time (let's say, 30 seconds), and the user does an action that requires a query to the database, I receive the "Attempted to read past of the stream" exception.

After searching on the Internet, I've found that this exception is related to the timeout variables in the MySQL server (concretely, "net_write_timeout" and "net_read_timeout". The problem is that my host provider does not let me change those values.

Is there any other way to solve this exception?

Thank you in advance!
Sandro

1 Answer, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 19 Sep 2014, 09:59 AM
Hi Sandro,

Thank you for contacting us.

Generally the error you are experiencing is thrown by MySql because the respective timeouts have been exceeded. Usually this can be attributed to network connection issues. That being said the error could also be caused by other specifics of your scenario related to connection management. Therefore we would need some additional details, could you please answer the following questions:
  1. Could you clarify what is the exact connection setup you referred to?
  2. Does each thread use a separate context object to work with the database or are multiple threads using the same context object?
  3. Are the used context objects initialized and disposed per operation or are they used to execute multiple separate operations before disposing them (long living context)?
  4. Does this issue occur if you use a local instance of MySql?
  5. Could you provide us with the code that causes the exception to be thrown and a stack trace?

This should allow us to gain better understanding of your scenario.

We are looking forward to your feedback.

Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Development (API, general questions)
Asked by
Sandro
Top achievements
Rank 1
Answers by
Kristian Nikolov
Telerik team
Share this question
or