getting error when multithreader program access data .
Exception in thread Thread-2:
ProgrammingError: (2014, \"Commands out of sync; you can\'t run this co
here is detail about the error: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html.
Mysqldb's manual suggest these:
Don't share connections between threads. It's really not worth your effort or mine, and in the end, will probably hurt performance, since the MySQL server runs a separate thread for each connection. You can certainly do things like cache connections in a pool, and give those connections to one thread at a time. If you let two threads use a connection simultaneously, the MySQL client library will probably upchuck and die. You have been warned.
For threaded applications, try using a connection pool. This can be done using the Pool module
See more information search keyword threadsafety on MySQLdb manual,