I am also seeing this with DB2 Connect from JBoss using Hibernate. The problem is intermittent, although it appears to only happen when the DB connection has been open for a long time (hours) with no activity. In other words, restarting JBoss and running the program within the next few minutes never results in the exception.
Log entry:
Code:
WARN [AbstractBatcher] [] exception clearing maxRows/queryTimeout
com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10120][10943] Invalid operation: statement is closed.
at com.ibm.db2.jcc.c.fg.A(fg.java:2329)
at com.ibm.db2.jcc.c.fg.getMaxRows(fg.java:597)
at org.jboss.resource.adapter.jdbc.WrappedStatement.getMaxRows(WrappedStatement.java:244)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:225)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:162)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1683)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
WARN [JDBCExceptionReporter] [] SQL Error: -4499, SQLState: null
ERROR [JDBCExceptionReporter] [] [ibm][db2][jcc][t4][2030][11211] A communication error has been detected. Communication protocol being used: TCP/IP.
Communication API being used: SOCKETS. Location where the error was detected: T4Agent.sendRequest().
Communication function detecting the error: OutputStream.flush(). Protocol specific error codes Software caused connection abort: socket write error, *, 0. Message: Software caused connection abort: socket write error
Hibernate 3.1.3
Java 1.5
IBM DB2 8
JBoss 4.0.3 SP1