Threading issue with SQLite

John Nagle nagle at
Sat Jan 30 19:23:39 CET 2010

Jonathan Gardner wrote:
> On Jan 29, 8:37 am, Alan Harris-Reid <aharrisr... at>
> wrote:
>> Questions...
>> 1.  Is there a large overhead in opening a new SQLite connection for
>> each thread (ie. within each method)?

> Suggestion: Use something like SQLAlchemy to manage you DB
> interactions. One day, you'll move away from SQLite, and you'll be
> glad you were programming at a higher level. SQLAlchemy also does
> things like connection pooling and such for you.

    Generally, if you get to the point where you're concerned about
concurrency performance issues with SQLite, it's time to upgrade
to a more serious database.  Especially if you're doing much updating.
SQLite can do multiple SELECT operations in parallel, but the entire
database is locked for all operations that write.

				John Nagle

More information about the Python-list mailing list