Re: [pysqlite] Concurrency - first steps

Roger Binns <[email protected]> Tue, 04 Nov 2008 13:18:20 -0800
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hugh Gibson wrote:
> For a long time we've used Python locks to control access to a database
> from multiple threads in PySQLite.

Are you trying to use the same Connection object (or cursors from it)
across multiple threads?

If that is the case then it is not safe.  (pysqlite prevents it by
default).  Using your own locking is ok but relying on that builtin to
APSW and pysqlite is not.  In the case of APSW you will get deadlocks.
In the case of pysqlite you will get core dumps.

I have fixed APSW for the next release but it also requires the next
version of SQLite to address various problems in SQLite.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkQvBcACgkQmOOfHg372QQFKgCgl1wd/Rbp3k6Tq8KwI4R+wSUN
/7EAoOR45YNh67HeL1nHaJEkcmrPyJ87
=ULcd
-----END PGP SIGNATURE-----