#9409: "OperationalError: database is locked" with Python 2.6 multiprocessing
and
SQLite backend
------------------------------------+---------------------------------------
Reporter: mrts | Owner: nobody
Status: reopened | Milestone:
Component: Documentation | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Comment (by ramiro):
Replying to [comment:6 mrts]:
> `OperationalError: database is locked` seems to imply the code is
thread-aware
> [...]
> So ''connections cannot be shared between threads'' seems to be
incorrect -- Django ORM seems to do it's job quite well when timeout is
larger with the sample code.
I don't know if these mailing list threads and documentation on
multithreaded access to SQLite databases are relevant, as gabor mentioned,
the `mutiprocessing` Python 2.6 module (formerly `pyprocessing`) you used
for your tests don't use threads but processes, see this SQLite
[http://sqlite.org/faq.html#q5 FAQ entry]. It seems very logical the fact
that if you are firing 100 (!) processes all of them trying to
'''insert''' one record to the same SQLite database table, at least some
of them will try to do so in a concurent way and you will get the failure.
--
Ticket URL: <http://code.djangoproject.com/ticket/9409#comment:9>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---