Hi Tore,

Is there a reason you can't simply wrap your updates in a 
`transaction.atomic()` blocks?

You should be able to avoid deadlocks and control exactly when data is 
written to disk
with this construct.

Simon

Le vendredi 4 mars 2016 15:02:45 UTC-5, Tore Lundqvist a écrit :
>
> 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/b1e83702-f098-467d-833f-daf387bda2ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to