Page 1 of 1

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

Posted: Tue 08 Nov 2005 17:18
by Guest
Hello,

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.

Thanks

Posted: Wed 09 Nov 2005 07:37
by Serious
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.

Posted: Mon 28 Nov 2005 15:50
by gwerner
Is it true that this can also happen when using connection pooling with multi-threaded apps?

Posted: Tue 29 Nov 2005 13:04
by Serious
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.