No, Massimo, is not ... With or without the try... except... the error is the same ... I've tried this several times.
The code of gist: https://gist.github.com/pyslan/5007364 (without try... except...) print it on the terminal server: <Row {'generation': 1, 'first_name': 'Root', 'id': 1}> <Row {'generation': 2, 'first_name': 'Teste', 'id': 2}> ERROR:web2py:Traceback (most recent call last): File "/home/ctx/PROJECTS/WEB/web2py/gluon/main.py", line 632, in wsgibase BaseAdapter.close_all_instances('rollback') File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 543, in close_all_instances db._adapter.close(action) File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 523, in close getattr(self, action)() File "/home/ctx/PROJECTS/WEB/web2py/gluon/dal.py", line 1670, in rollback if self.connection: return self.connection.rollback() ProgrammingError: (2014, "Commands out of sync; you can't run this command now") On Sat, Feb 23, 2013 at 5:58 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This is causing the problem. What if you remove the try... except? What > ticket do you get? > > try: > raw_rows = db.executesql('CALL sp_recursive_start(1);', fields=fields) > except Exception, e: > print 'ERROR NOW:', e > db.rollback() > > > > > On Saturday, 23 February 2013 12:58:44 UTC-6, __pyslan__ wrote: >> >> After reading this >> thread<http://en.usenet.digipedia.org/thread/16137/52728/>, >> as Anthony suggested, I tried this: >> >> import MySQLdb >> from gluon.dal import MySQLAdapter >> MySQLAdapter.driver = MySQLdb >> >> After that, even commenting this block of code I get the result correctly >> because the print rows, but the error below is thrown anyway: >> >> Traceback (most recent call last): >> File "/media/sda3/pyslan/PROJECTS/**web2py/gluon/main.py", line 632, in >> wsgibase >> >> BaseAdapter.close_all_**instances('rollback') >> >> File "/media/sda3/pyslan/PROJECTS/**web2py/gluon/dal.py", line 543, in >> close_all_instances >> >> db._adapter.close(action) >> >> File "/media/sda3/pyslan/PROJECTS/**web2py/gluon/dal.py", line 523, in >> close >> >> getattr(self, action)() >> >> File "/media/sda3/pyslan/PROJECTS/**web2py/gluon/dal.py", line 1670, in >> rollback >> >> if self.connection: return self.connection.rollback() >> ProgrammingError: (2014, "Commands out of sync; you can't run this command >> now") >> >> >> >> The code: >> https://gist.github.com/**pyslan/5007364<https://gist.github.com/pyslan/5007364> >> >> Something related with this? >> https://groups.google.com/**forum/#!msg/web2py/**1s7vDix8QC8/mgvot4PEvBgJ<https://groups.google.com/forum/#!msg/web2py/1s7vDix8QC8/mgvot4PEvBgJ> >> >> >> >> >> >> -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.