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

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

Postby Guest » Tue 08 Nov 2005 17:18

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
Guest
 

Postby 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.
Serious
 

Postby gwerner » Mon 28 Nov 2005 15:50

Is it true that this can also happen when using connection pooling with multi-threaded apps?
gwerner
 
Posts: 3
Joined: Fri 13 May 2005 20:10

Postby 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.
Serious
 


Return to dotConnect for MySQL