Hello,
We have a java application that struggles to connect to DB2. We are using icr.io/db2_community/db2:11.5.9.0 in a docker-compose set-up.
The java application has been recently migrated to Java 17, and in our testing, we noticed issues at start-up. The previous version of the java application, based on Java 11, didn't show issues connecting to the same version of DB2 ( 11.5.9.0).
The traces below are from the java application.
In some cases, it takes a long time to achieve connectivity, we see this:
2024-12-20T13:40:37,564 [Default Executor-thread-12] [] INFO util.ConnectionProxyHandler - Going to get connection..
2024-12-20T13:40:37,663 [Default Executor-thread-12] [] WARN util.ConnectionProxyHandler - CTJOT0857W The database is unavailable. Retry connecting to the database in 10 seconds. Retry number 19/20.
2024-12-20T13:40:47,664 [Default Executor-thread-12] [] INFO util.ConnectionProxyHandler - Going to get connection..
2024-12-20T13:40:47,739 [Default Executor-thread-12] [] WARN util.ConnectionProxyHandler - CTJOT0857W The database is unavailable. Retry connecting to the database in 10 seconds. Retry number 20/20.
2024-12-20T13:40:57,741 [Default Executor-thread-12] [] INFO util.ConnectionProxyHandler - Going to get connection..
2024-12-20T13:40:57,820 [Default Executor-thread-12] [] ERROR util.ConnectionProxyHandler - CTJOT0858E Fatal Error : Could not connect to the database.
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1035, SQLSTATE=57019, SQLERRMC=null, DRIVER=4.25.29
at com.ibm.db2.jcc.am.b6.a(b6.java:815) ~[db2jcc.jar:?]
at com.ibm.db2.jcc.am.b6.a(b6.java:66) ~[db2jcc.jar:?]
at com.ibm.db2.jcc.am.b6.a(b6.java:140) ~[db2jcc.jar:?]
at com.ibm.db2.jcc.am.Connection.completeSqlca(Connection.java:5269) ~[db2jcc.jar:?]
This issue can be resolved by bringing the services down, and up again.
In other cases, we got connectivity faster but then get this error:
"2025-01-09T06:58:12,150 [Default Executor-thread-11] [] ERROR jdo.JdoDbInit - [JdoDbInit.E.9] DB schema was parially created. Please drop and re-create the schema
2025-01-09T06:58:12,152 [Default Executor-thread-11] [] ERROR jdo.JdoDbInit - [JdoDbInit.E.1] JdoDbInit.initDb() failed
com.ibm.cdb.topomgr.jdo.JdoInitException: [JdoDbInit.E.9] DB schema was parially created. Please drop and re-create the schema
We are wondering what could be causing those issues, and how to investigate what's happening from the DB2 side ?
This page https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads shows that JDBC driver 4.25.29 corresponds to DB2 Level v11.1 M4 FP7. But I am not sure if it is relevant ?
Any help would be very appreciated.
Thanks,
Delphine.