Commands out of sync, You can't run this command now.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply

Commands out of sync, You can't run this command now.

Post by Guest » Tue 08 Nov 2005 17:18


I get this occasionally. Are there common causes for this error? It doens't seem to be tied to a specific command, but any number of queries that I have in the current application.



Post by Serious » Wed 09 Nov 2005 07:37

This error occurs when you have more than one data reader opened on single connection.
To prevent this error you have to avoid opening several data readers on same connection and explicitly close each data reader after use or use FetchAll mode in all your MySqlCommand objects.

Posts: 3
Joined: Fri 13 May 2005 20:10

Post by gwerner » Mon 28 Nov 2005 15:50

Is it true that this can also happen when using connection pooling with multi-threaded apps?


Post by Serious » Tue 29 Nov 2005 13:04

I've described the reasons that can cause this problem. Connection pooling just as other features in MySQLDirect .NET is designed for work in multithreading environment equally well as in single-threaded environment, but it is you who has to care about data reading and writing synchronization.

Post Reply