On Wednesday, February 26, 2014 11:58:54 PM UTC+2, tapan pandita wrote:
>
> I am using transaction.atomic as a context manager for transactions in 
> django 1.6. There is a block of code which I want to be in a transaction 
> which has a couple of network calls and some database writes. I am seeing 
> very weird behaviour. Every once in while (maybe 1 in 20 times) I have 
> noticed a partial rollback happening without any exception having been 
> raised and the view executing without any errors. My application is hosted 
> on heroku and we use heroku postgres v9.2.8.
>
> I have described the problem in greater detail here 
> http://stackoverflow.com/questions/22053846/weird-behaviour-for-transactions-in-django-1-6-1
>
> Any ideas?
>

Partial rollback shouldn't happen. Are you absolutely sure there is a 
rollback? For example concurrent modification could lead to saving old 
values back to the DB.

One way to check what is happening is to switch on all logging for the 
problematic part of code (use "SET log_statement to 'all';") , then 
checking database logs. You don't want to turn log_statement to 'all' if 
your app generates a lot of queries.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3fc9a79-521e-4b5c-b08d-98e7e585b117%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to