cur.close() when con.close() is next line or not?
"Nikos Kouremenos" <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Hello, in the pysqlite samples you don't close cursor before closing
connection (pure logic suggets cursor gets closed by connection
closing).
BUT, when cur.execute('UPDATE whatever') and then con.close() I was
getting a TraceBack with unfinished something.
I looked it up in the ML, and everyone suggested cur.close(), which
yes fixed the problem.
So, now I ask: cur.close() is a good idea to have, and why if missing
[as everywhere] it's okay until we do an UPDATE
shouldn't be the behaviour more consisting? (my vote is that we don't
need cur.close() no matter what we do, this is python).
Thanks and please oh please reply :)
PS.
yes I do on demand opening and closing. That rocks