|
From: Rumbalski, S. (Dublin) <ser...@ch...> - 2008-05-21 20:16:22
|
I just switched from using a generic ODBC connection to using PyDB2. For the most part the transition was painless, but I encountered some trouble.
With the old library I would only maintain a reference to the cursor, but not to the connection object. When I tried this with PyDB2 I got an error: Error: ('I', -1, 'Invalid Handle'). I fixed this by keeping a reference to the connection object. Apparently the cursor object does not keep a reference to the connection object, so when I call cur.execute(query_text), the connection object has been garbage collected.
Is this correct behavior? It seems like a usability bug, if not an actual one.
Steven Rumbalski
Data Analyst, E-Banking Services
CheckFree - now part of Fiserv
Phone: 614.564.4198
Fax: 614.564.3570
http://www.checkfree.com<http://www.checkfree.com/>
|