I have a lengthy process (python component for crossbar.io) that uses django ORM to save to the database.
My problem is that when it overcomes the connection timeout without mysql support, it does not auto-adjust, just throw [2006, u'MySQL server has gone away']
I tried to define CONN_MAX_AGE in django settings for up to 60 seconds, so it should close the connection every minute and reopen it on demand, but it does not work.
My settings.py options are as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'name',
'USER': 'user',
'PASSWORD': 'password',
'CONN_MAX_AGE': 60
}
}
And in the application, I just use the usual simple operations of the CRUD model without doing it manually (as this seems to disable the django auto-join feature, as mentioned in other similar issues)