I just switched to Django 1.6 (with Posgres 9.1) and there is a few questions that I couldn't answer myself:
(Answered) Is there a statement that prints/shows me if I am currently inside one or more and in which
transaction.atomic
blocks?(Answered) I neither have
TransactionMiddleware
enabled nor setATOMIC_REQUESTS
to True. So per default my code is not wrapped inside atransaction.atomic
block, correct?Are sql statements that are executed via cursor committed properly when executed inside a
transaction.atomic
block? Is there another/better way to commit them?with transaction.atomic(): cursor = connection.cursor() cursor.execute(sql)
Do I need to wrap
cursor.executemany()
in atransaction.atomic
block or does the execution already happen atomically?How can I see the current
autocommit
status? When is the status set, at the beginning of a connection, a transaction, as global database setting?