#26299: Rollback bug on Postgres for multidb applications
---------------------------------+--------------------
     Reporter:  silviogutierrez  |      Owner:  nobody
         Type:  Uncategorized    |     Status:  new
    Component:  Uncategorized    |    Version:  1.9
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 Hi there,

 Was putting together a fairly straightforward multidb project:

 1. Most models go in db1
 2. Some models in a special app go to db2.
 3. Models from db2 don't ever communicate with db1.

 Noticed that, in tests, rollbacks do not work for models in db2. I thought
 it could be environmental, but I setup a very simple project to reproduce,
 see https://github.com/silviogutierrez/django-multidb-bug

 You just need to install the requirements, activate the virtual env and
 run `python manage.py test --keepdb` *twice*. You'll notice the model
 created in the test are not cleared.

 Note that it is the `--keepdb` flag that triggers the bug, as uniqueness
 constraints will fail for unique fields.

 For the purposes of this demo, and just to reproduce this bug, I routed
 all requests to db2.

 Hope this helps someone. Oddly enough, I do see a rollback statement in my
 DB logs, but it doesn't "take."

 Thanks for an awesome project,

 Silvio

--
Ticket URL: <https://code.djangoproject.com/ticket/26299>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.c42dda8f5c2d3543166b832c6d25bee3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to