Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-28 Thread Michael Bayer
I couldn’t tell you, it shouldn’t happen in the first place. Would need code that illustrates the problem. On Mar 27, 2014, at 9:27 PM, Ni Wesley nisp...@gmail.com wrote: MySQLdb has the same problem. So, no concurrent, I just use engine(with default connection pool) execute. Then, how to

[sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Ni Wesley
Hi all, Today I get an error as title. I use sqlalchemy + mysql. Here is my code snippet: def dbquery(_table,whereclause): try: #_table=Table(tablename, metadata, autoload=True) #_table = tables[tablename] i=_table.select().where(whereclause) if

Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Michael Bayer
when the DBAPI cursor has no .description object, it is determined to not be a result-row returning object. The MySQLDB DBAPI has been observed to occasionally have issues in this area, when a connection gets into a bad state. There are likely patterns in how you're calling it that lead it to

Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Ni Wesley
It's not happening everytime. And I am not using mysql-python, instead, I use pymysql. So, the root cause is connection in bad state? How to fix or work around from sqlalchemy side? Wesley 在 2014年3月27日星期四UTC+8下午8时58分40秒,Michael Bayer写道: when the DBAPI cursor has no .description object, it is

Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Ni Wesley
It's not happening everytime. And I am not using mysql-python, instead, I use pymysql. So, the root cause is connection in bad state? How to fix or work around from sqlalchemy side? Wesley 在 2014年3月27日星期四UTC+8下午8时58分40秒,Michael Bayer写道: when the DBAPI cursor has no .description object, it is

Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Michael Bayer
On Mar 27, 2014, at 9:14 AM, Ni Wesley nisp...@gmail.com wrote: It's not happening everytime. And I am not using mysql-python, instead, I use pymysql. So, the root cause is connection in bad state? How to fix or work around from sqlalchemy side? I don’t really know, I’d need to have a

Re: [sqlalchemy] this result object does not return rows. it has been closed automatically

2014-03-27 Thread Ni Wesley
MySQLdb has the same problem. So, no concurrent, I just use engine(with default connection pool) execute. Then, how to work around the problem, for my query operation, if catch this exception, query again? 在 2014年3月27日星期四UTC+8下午11时42分19秒,Michael Bayer写道: On Mar 27, 2014, at 9:14 AM, Ni