Regardless of the particular problem I have got shouldn't it be possible to disable Djangos transactional management if you want to?
Is not transaction.set_autocommit(False) doing that? Is it not surprising to get a TransactionManagementError when you have turned of the transaction management? There is also another broken thing with set_autocommit(False) if the database connection has timed out and is reconnected by Django, autocommit is set to True again, that was kind of surprising and ugly to workaround. Den fredag 4 mars 2016 kl. 21:02:45 UTC+1 skrev Tore Lundqvist: > > Reply to comments in ticket: > https://code.djangoproject.com/ticket/26323#comment:10 > > Hi, > > @Aagustin: I get your point but in the code I'm working on there is a lot > of transaction.commit(), not to handle transactions but to manage when data > is written to disk and to avoid deadlocks. Running in autocommit mode does > not work, its slow and sometimes the commits is used to save in a known > good state. So I disable autocommit with transaction.set_autocommit(False) > and run the code with explicit commits in it and than turn autocommit on > again. > > The documentation for set_autocommit says "Once you turn autocommit off, > you get the default behavior of your database adapter, and Django won’t > help you." That is what I want and thats way I think that > the TransactionManagementError should not de raise if your not using atomic > blocks. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/52428d2f-7ebe-48eb-8c28-98b1c5c7ae69%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.