Threading issue with SQLite

John Nagle nagle at animats.com
Sat Jan 30 13:23:39 EST 2010


Jonathan Gardner wrote:
> On Jan 29, 8:37 am, Alan Harris-Reid <aharrisr... at googlemail.com>
> 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