Hi there,

I am using SQLAlchemy in a multi-threaded app with a SQLite backend.
I've been careful to scope sessions down to a single method and made
sure a session is never used by more than one thread.

Some threads are reading data from the DB, some are writing it, some
are updating it. As could have been expected, those commit() calls
committing updates or inserts sometimes error out with
"OperationalError: (OperationalError) database is locked" errors.

I can only imagine another thread is in the middle of reading from or
writing to the DB and in possession of a shared or exclusive lock.

It appears SQLAlchemy won't wait for the lock to become available nor
will it retry a failed operation - is that correct? Is there a
recommended pattern or method for handling multiple simultaneous reads
and writes? Given that some of the data from the DB is being lazy
loaded as instances are being used, how would I use mutexes to control
access to the DB (if that's even what I should be doing)?

I'd be happy to provide more information if necessary. Thanks,

-dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to