﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26299	Rollback bug on Postgres for multidb applications	Silvio J. Gutierrez	nobody	"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"	Uncategorized	closed	Uncategorized	1.9	Normal	invalid			Unreviewed	0	0	0	0	0	0
