In Django 1.5.x, I have a long running management command where select queries are returning stale data. I suspect this is due to the fact that they are running within a transaction that are started earlier on the db connnection. Is there a way a tell if a query runs within a transaction or it is in autocommit mode?
(this is somewhat more focused version of an earlier question I posted at https://stackoverflow.com/questions/18540099/orm-does-not-return-recent-database-changes)