We're running into a scenario where the db 2 connection is timing out during reads.
Is there a way to increase the timout value, somehow ?
We get the following stack trace:
com.ibm.db2.jcc.c.DisconnectException: A communication error has been
detected. Communication protocol being used: Reply.fill(). Communication
API being used: InputStream.read(). Location where the error was
detected: Read timed out. Communication function detecting the error: *.
Protocol specific error codes(s) TCP/IP SOCKETS
at com.ibm.db2.jcc.b.bb.b(bb.java(Compiled Code))
at com.ibm.db2.jcc.b.bb.c(bb.java(Inlined Compiled Code))
at com.ibm.db2.jcc.b.bb.c(bb.java(Compiled Code))
at com.ibm.db2.jcc.b.bb.v(bb.java(Inlined Compiled Code))
at com.ibm.db2.jcc.b.eb.a(eb.java(Compiled Code))
at com.ibm.db2.jcc.b.r.a(r.java(Inlined Compiled Code))
at com.ibm.db2.jcc.b.ub.c(ub.java(Inlined Compiled Code))
at com.ibm.db2.jcc.c.ad.Z(ad.java(Inlined Compiled Code))
at com.ibm.db2.jcc.c.ad.d(ad.java(Compiled Code))
at com.ibm.db2.jcc.c.ad.W(ad.java(Compiled Code))
at com.ibm.db2.jcc.c.ad.execute(ad.java(Compiled Code))
Are there any messages in db2diag.log on either the client or the server? (It's location depends on the OS, eg under C:\program files\ibm\sqllib on a Windows system, ~instance-owner on a *ix system - but can vary.)
I have a suspicion that this is really a comms problem - not a DB2 problem. You might need to, on your client, in a DB2 command environment
db2 "update dbm cfg using diaglevel 4"
rerun the error
db2 "update dbm cfg using diaglevel 3"
The db2diag.log might now show a SQLCA with sqlcode -30081. The tokens in the sqlerrmc field should give a better idea of the problem.
The problem was the type 4 JDBC driver.
We were having deadlocks on the DB2 server side and the type 4 JDBC driver was throwing a SocketTimeoutException and closing the connection. When we switched to a type 2 driver it correctly reported the deadlock error and kept the connection alive.