[pysqlite] again "Unable to close due to unfinalised statements"
Luc Saffre
luc.saffre at gmx.net
Sat Aug 27 14:35:09 CEST 2005
Thanks, Jim and Emmanuel, for your quick answers.
This was indeed my mistake.
Luc
On 26.08.2005 17:07, Luc Saffre wrote:
> Hello,
>
> I am having again an "OperationalError: Unable to close due to
> unfinalised statements", and I don't see how I can avoid it. Here is a
> test case which should reproduce the problem (I use pysqlite 2.0.3 on
> Win32+Python 2.3).
>
> Any hints?
>
> Luc
>
> import pysqlite2.dbapi2 as sqlite
> from unittest import TestCase, main
>
> class Case(TestCase):
>
> def test01(self):
>
> self.assertEqual(sqlite.version,'2.0.3')
>
> conn = sqlite.connect(':memory:')
> csr = conn.cursor()
>
> csr.execute("""CREATE TABLE Partners (
> id BIGINT,
> name VARCHAR(50),
> PRIMARY KEY (id)
> );""")
>
> csr.execute("""INSERT INTO Partners (id, name)
> VALUES ( 2, 'Andreas Arens')""")
>
> csr.execute("""
> UPDATE Partners SET name = 'Arens, Andreas'
> WHERE id = 2; """)
>
> conn.commit()
> conn.close()
>
>
> if __name__ == '__main__':
> main()
> _______________________________________________
> pysqlite mailing list
> pysqlite at lists.initd.org
> http://lists.initd.org/mailman/listinfo/pysqlite
>
>
More information about the pysqlite
mailing list