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 this library in a project with DATABASE_ROUTERS.
As soon as django_apscheduler is not in the 'default' database, I get the following error message:
"select_for_update cannot be used outside of a transaction".
Hi,
I use this library in a project with DATABASE_ROUTERS.
As soon as django_apscheduler is not in the 'default' database, I get the following error message:
"select_for_update cannot be used outside of a transaction".
django-apscheduler/django_apscheduler/models.py
Line 165 in a792c1a
Which in my opinion is also conclusive, because atomic points to the 'default' db without parameters.
The following sample change fixes my problem:
DATABASE_APPS_MAPPING = {
'django_apscheduler': 'test',
}
with transaction.atomic(using='test'):
Is there another approach to this problem case? I couldn't find any other solution when django_apscheduler is not in my 'default' db.
version:
Django==3.2.9
django-apscheduler==0.6.2
The text was updated successfully, but these errors were encountered: