Is it possible to combine raw SQL statements with Django's convenient
model.save() in one transaction?
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---