You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use django-pyodbc-azure 2.1.0.0 for the connection with an Azure SQL database which works fine.
When I understand the documentation of django-pyodbc-azure correctly, transactions should be supported.
However, this code immediately updates the row. I would expect, that the row is updated after 20 seconds.
from django.db import transaction
from myapp.models import MyModel
import time
with transaction.atomic():
MyModel.objects.filter(id=1).update(my_field='Test')
time.sleep(20)
Am I doing something wrong? Do I need to specifiy certain settings on the Azure SQL database?
I found something similar with 2.1.0.0 when doing migrations. My migration had several steps, a later one failed and instead of rolling all steps back, the previous steps were still applied. An output of the SQL produced something like this:
BEGIN TRANSACTION
**alter table steps
COMMIT;
Running the same SQL directly in management studio produced the same failed step as via migrate, however all the previous steps were rolled back as expected.
I use
django-pyodbc-azure
2.1.0.0 for the connection with an Azure SQL database which works fine.When I understand the documentation of
django-pyodbc-azure
correctly, transactions should be supported.However, this code immediately updates the row. I would expect, that the row is updated after 20 seconds.
Am I doing something wrong? Do I need to specifiy certain settings on the Azure SQL database?
My current settings.py
The text was updated successfully, but these errors were encountered: