Closed ftamy9 closed 1 year ago
Same issue here. Did you manage to solve the problem @ftamy9 ? Any idea @altairbow ?
Python 3.9, Django 3.2.7, Oracle 19
So it looks like the Oracle connections created with SQLAlchemy (which django-db-connection-pool is based on) have their autocommit flag set to 0 by default.
A quick test of setting the flag to 1 after the connection has been returned by the pool confirmed the assumption and Django started persisting my changes all of a sudden again.
I fixed it by implementing _set_autocommit in oracle/base.py and submitted a pullrequest here: https://github.com/altairbow/django-db-connection-pool/pull/35
So it looks like the Oracle connections created with SQLAlchemy (which django-db-connection-pool is based on) have their autocommit flag set to 0 by default.
A quick test of setting the flag to 1 after the connection has been returned by the pool confirmed the assumption and Django started persisting my changes all of a sudden again.
I fixed it by implementing _set_autocommit in oracle/base.py and submitted a pullrequest here: #35
Great work! Thanks, PR has been merged, and version 1.2.0 has been released.
Great work! Thanks, PR has been merged, and version 1.2.0 has been released.
Perfect, thanks for the quick action!
Thanks @altairbow , I have same problem. I can not save correctly. the program looks ok without error but the table is not update when I check it on django admin. It works ok when I use (('ENGINE': 'django.db.backends.oracle')) with out the pool.
Python3.8.10 + django 3.2 + Oracle 18C
'default': { 'ENGINE': 'dj_db_conn_pool.backends.oracle', 'POOL_OPTIONS': { 'POOL_SIZE': 10, 'MAX_OVERFLOW': 10, 'RECYCLE': 24 60 60, }, 'AUTOCOMMIT': True, 'NAME': 'xxx', 'USER': 'xxx', 'PASSWORD': 'xxx', }
Originally posted by @boscharun in https://github.com/altairbow/django-db-connection-pool/issues/5#issuecomment-494926473