IBM / python-itoolkit

itoolkit is a Python interface to the XMLSERVICE toolkit for the IBM i platform.
MIT License
19 stars 13 forks source link

SQL commands in SQLRPGLE programs causing ibm_db.connect (from ibm_db library) to fail for new connections #53

Closed edmundpf closed 1 year ago

edmundpf commented 4 years ago

This is a strange issue that I've come across:

I'm calling SQLRPGLE programs using the iToolkit library, for some reason when I call a program that has SQL statements like select, insert, etc. the connection is somehow being locked and other users intermittently cannot connect and the ibm_db.connect method (from ibm_db library) fails and returns None. I'm not sure if anyone had a similar issue and I realize the issue comes from calling a different library but the stack trace fails in this method, any help would be greatly appreciated!

Thanks in advance

kadler commented 4 years ago

This is a strange sounding bug. Can you please list the version of itoolkit, ibm_db, Python, and IBM i you are running on. Also, which transport are you using to connect in itoolkit?

edmundpf commented 4 years ago

This is a strange sounding bug. Can you please list the version of itoolkit, ibm_db, Python, and IBM i you are running on. Also, which transport are you using to connect in itoolkit?

Python: 3.4.6 itoolkit: 1.2 ibm-db: 2.0.5.4 IBMi: V7R3M0 L00

Using iToolkit as follows:

self.itool = iToolkit(iparm=0, iret=0, ids=1, irow=1)
self.itransport = iLibCall()
self.itool.add(iPgm('pgm_call', 'SQLRPGLE_PGM_HERE'))
self.itool.call(self.itransport)
kadler commented 4 years ago

So, I take it you're running with the versions that we initially shipped with OPS?

I'm at a loss as to how this could be occurring. You're using iLibCall, which does not use ibm_db at all. Are the ibm_db connection failures occurring in the job that's running iToolkit or in a different job?

edmundpf commented 4 years ago

They're happening in the ibm_db connection somehow, very strange indeed. I haven't been able to narrow down the commands in the SQLRPGLE program causing this (no minimal SQLRPGLE code found yet). I do know the program called uses service programs, and SQL, this has been our first program we've called with iToolkit using these and it's uncanny that it will consistently cause these seemingly unrelated issues. I'll let you know if I can identify a minimal RPG example to cause what I'm experiencing

jkyeung commented 3 years ago

I don't know how SQLRPGLE figures into this, but it sounds suspiciously like a server mode issue to me.

kadler commented 2 years ago

@edmundpf did you ever figure out the problem here?