On Mon, Sep 6, 2010 at 4:47 PM, Robert Gravsjö <rob...@blogg.se> wrote: > Patryk Zawadzki skrev 2010-09-06 15.29: >> The isolating transaction keeps going on until you either (1) commit, >> (2) rollback or (3) disconnect. Django only commits/rollbacks the >> transactions it explicitly starts, it does not care about the >> implicitly started isolating transaction. That's what results in >> "<IDLE> in transaction" and I can reproduce it with a two-line view >> that does a simple SELECT with no transaction middleware involved. > Can you please show me the code you're running to reproduce this?
Right, I misremembered the original problem. I've now found the testing environment. The problem is not with regular views but with Celery tasks, long-running management commands such as daemons and any other place where you access the ORM from outside of the usual request→dispatcher→view→response flow. These cases all end up with an isolating transaction spanning their whole life span. In case of daemons it results in permanently blocking the database structure (for example causing "VACUUM FULL" to hang). It would be more useful if you could explicitly enter_isolation_block() and leave_isolation_block() as needed (currently there is no way to commit the isolating transaction other than doing a raw SQL query or accessing psycopg internals). Sorry about the confusion, it's not really related to views. -- Patryk Zawadzki -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.