Re: TransactionManagementError from inside atomic block

2017-03-29 Thread Ketan Bhatt
Hey Simon, Thank you for your response, we were able to resolve the problem soon after I posted the query. And yes, you are correct, it was an issue with having multiple DB connections and the `auto-commit` being turned off for one, but then another connection being used for querying. We earlier

Re: TransactionManagementError from inside atomic block

2017-03-29 Thread Simon Charette
Hi Ketan, I'm afraid this will be really hard to solve without the code that is raising this exception. Some details that could help debug the issue: 1. Are your workers multi-threaded? 2. Are you sure you are not calling functions performing manual transaction management? 3. Is your atomic()

TransactionManagementError from inside atomic block

2017-03-25 Thread Ketan Bhatt
I have a method that updates a row in the table. To avoid race condition, I locked the row using `select_for_update` inside an `atomic` block and doing the update. This method is called from a celery task. This works well on my local machine. But when this gets called on my production server (two