I use MySQL/InnoDB and need to place some raw SQL inside a transaction
block:
cursor = connection.cursor()
cursor.execute("""
START TRANSACTION;
UPDATE ...
""")
...
model.save()
...
cursor.execute("COMMIT;")
As you can see I have some other database manipulations (saving a
model/form) that should be part of this transaction too.
I use the TransactionMiddleware to get the transactions tyed to the HTTP
request but I don't know how to integrate that with the raw SQL.
Or is this just not possible and I have to write raw SQL for all code
belonging to the transaction above.
Regards,
Constantin