webpy/webpy — Issue #115: Calling simple procedure raises ProgrammingError: (2014, "Commands out of sync; you can't run this command now")
Author: marcelomendes
Created: 2011-11-03 13:46:58+00:00
State: open

I'm having this issue while trying to call a procedure that performs a select ,

>>> import web
>>> db = web.database(dbn='mysql', db='mydata', user='dbuser', pw='foo')
>>> db.query("call sp_myprocedure")
627 if not self.ctx.transactions:
--> 628 self.ctx.commit()
629 return out
630

/usr/lib/pymodules/python2.7/web/db.pyc in commit(unload)
502 def commit(unload=True):
503 # do db commit and release the connection if pooling is enabled.

--> 504 ctx.db.commit()
505 if unload and self.has_pooling:
506 self._unload_context(self._ctx)

ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

After googling around I found that this has to do with a open cursor not being closed or so. I can call this procedure normaly from mysql prompt or from MySQLdb python module. What is the correct way of calling procedures with web.py db api?