#9409: "OperationalError: database is locked" with Python 2.6 multiprocessing
and
SQLite backend
---------------------------------------------------+------------------------
Reporter: mrts | Owner: nobody
Status: closed | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Resolution: invalid | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by mtredinnick):
* status: new => closed
* resolution: => invalid
Comment:
There's no Django bug here; it's expected behaviour. The threadsafety
level for sqlite3 is 1, which means connections cannot be shared between
threads.
In normal operations, the backend is imported into each thread, so there's
a separate `DatabaseWrapper` instance and hence a separate connection.
Your test case is not normal, in that it's reusing the connection between
threads. The bug is in the assumption that it's safe to do that.
--
Ticket URL: <http://code.djangoproject.com/ticket/9409#comment:4>
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
-~----------~----~----~----~------~----~------~--~---