ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

DB2 connection pool is unavailable after DB2 server restart #971

Closed DaisyYangl closed 5 months ago

DaisyYangl commented 6 months ago

Hi team, Our application is using Node.js with ibm_db : "^2.8.1",

In the code, we use connection pool to connect DB2. Every time, when the DB2 server maintenance(restarted), our application will lose the DB2 connection. After restarted, logs of Pool is as follows (there's no SQL error) ===pool=== <ref 1> Pool { options: { connectTimeout: 60, pool: [Circular 1], connStr: 'DATABASE=xx;HOSTNAME=xxx;UID=xx;PWD=xx;PORT=xx;PROTOCOL=TCPIP;Security=SSL;SSLServerCertificate=/xx;' }, maxPoolSize: 0, index: 0, availablePool: { 'DATABASE=xx;HOSTNAME=xxx;UID=xx;PWD=xx;PORT=xx;PROTOCOL=TCPIP;Security=SSL;SSLServerCertificate=/xx;': [ [Database] ] }, usedPool: { 'DATABASE=xx;HOSTNAME=xxx;UID=xx;PWD=xx;PORT=xx;PROTOCOL=TCPIP;Security=SSL;SSLServerCertificate=/xx;': [] }, poolSize: 1, queue: SimpleQueue { fifo: [], executing: true }, odbc: ODBC {} }

Then the get connection action will pop up: { message: 'Connection not open.' } Do you have any suggestion how to deal with this situation? Thanks a lot!

Steps to Reproduce:

  1. Using DB2 connection pool in code
  2. Restart DB2 server
  3. Enter application and found the SQL query is timeout.
bimalkjha commented 6 months ago

@DaisyYangl We have fixed multiple connection pooling related issues in ibm_db@3.2.3. I would suggest you to reinstall ibm_db using npm install ibm_db@latest command then verify the issue. Please share your test result using v3.2.3 here. Thanks.