ibmdb / python-ibmdb-django

IBM DB2 Driver for the Django application Framework
Apache License 2.0
29 stars 42 forks source link

Function sequence error when running parallel queries #86

Closed rajddesai closed 7 months ago

rajddesai commented 1 year ago

Python driver: https://pypi.org/project/ibm-db/3.1.4/

Django adapter: https://pypi.org/project/ibm-db-django/1.5.2.0/

Adapter properties:

DATABASES = {
    'default': {
        'ENGINE': 'ibm_db_django',
        'NAME': '---',
        'USER': '---',
        'PASSWORD': os.environ.get("DB2_PASSWORD"),
        'HOST': '---',
        'PORT': '---',
        'PCONNECT': True,
        'AUTOCOMMIT': False,
        'ATOMIC_REQUESTS': True,
    },
    'original': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

Exceptions: Parallel queries are throwing Function sequence error

Request Method: GET
Django Version: 3.2.18
Exception Type: Error
Exception Value:    
[IBM][CLI Driver] CLI0125E  Function sequence error. SQLSTATE=HY010 SQLCODE=-99999
Exception Location: /usr/local/lib/python3.8/site-packages/ibm_db_dbi.py, line 1495, in _fetch_helper

Also Connection is not active errors.

Request Method: GET
Django Version: 3.2.18
Exception Type: ProgrammingError
Exception Value:    
Connection is not active
Exception Location: /usr/local/lib/python3.8/site-packages/ibm_db_dbi.py, line 684, in pconnect
imavo commented 1 year ago

@rajddesai , Can you please attach the smallest sample program that allows someone else to recreate the symptom in order to investigate. Separately, if you have the skill, you can get a CLI trace when running your python-sript , to expose the exact sequence of CLI requests and responses, which will also show you the error and let you investigate and often find the cause, again if you have the skill. Refer to the Db2 online documentation for details of getting a CLI trace (db2trc on -f your_trace.dmp , run your script, db2trc off, db2trc fmt -cli your_trace.dmp your_trace.fmtcli ).

praveen-db2 commented 1 year ago

@rajddesai is your problem solved ? Can we close this case ?

rajddesai commented 1 year ago

No this is still an issue

praveen-db2 commented 11 months ago

@rajddesai can you please provide us smallest sample program that allows someone else to recreate the symptom in order to investigate. Separately, if you have the skill, you can get a CLI trace when running your python-sript , to expose the exact sequence of CLI requests and responses, which will also show you the error and let you investigate and often find the cause, again if you have the skill. Refer to the Db2 online documentation for details of getting a CLI trace (db2trc on -f your_trace.dmp , run your script, db2trc off, db2trc fmt -cli your_trace.dmp your_trace.fmtcli ).

praveen-db2 commented 9 months ago

closing this issue, as there is no response, user is free to reopen if needed.

rajddesai commented 9 months ago

@praveen-db2 All you have to do is run several parallel API calls that is it. Super simple to reproduce. I'd keep this open as it is a super big issue.

rajddesai commented 9 months ago

@praveen-db2 I don't have the option to reopen this one.

praveen-db2 commented 9 months ago

@rajddesai As our adapter is run against Django test suite, which contains tests on scenario you said, we didnt face any such issue. It would be better if you would provide us sample program to reproduce. It will narrow down to root cause.