#25714: DatabaseError: DatabaseWrapper objects created in a thread can only be 
used
in that same thread.
-------------------------------------+-------------------------------------
     Reporter:  brian                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

 I can't tell from the original report which database the person is using
 as the PostgreSQL, MySQL and SQLite adapters are installed. Django allows
 sharing SQLite connections across threads but not PostgreSQL and MySQL
 connections.

 Generally speaking database connections should only be accessed through
 `from django.db import connection` or `from django.db import connections;
 connections[alias]`. This returns thread local objects and avoids this
 problem.

 The TinycryptoPOS application appears to run a daemon; I'm not sure what
 it does exactly but I suspect that's how a connection ends up being
 accessed incorrectly. If every Django user saw that error, we'd probably
 have heard about it by now, so I suspect the bug is in TinycryptoPOS.

--
Ticket URL: <https://code.djangoproject.com/ticket/25714#comment:2>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.b4b7cf5da2e5bfb134b0c6d6163f5ef4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to