JDBC error reported: (SQLState = HY000) - java.sql.SQLException: [tibcosoftwareinc][SQLServer JDBC Driver]Object has been closed.

JDBC error reported: (SQLState = HY000) - java.sql.SQLException: [tibcosoftwareinc][SQLServer JDBC Driver]Object has been closed.

book

Article ID: KB0074620

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 5.x

Description

JDBC Query activity was configured to query in subset mode. Iteration (step to next subset of rows) might take up to 10 minutes. Next iteration reports, “Object has been closed” SQLException.

 

Issue/Introduction

JDBC error reported: (SQLState = HY000) - java.sql.SQLException: [tibcosoftwareinc][SQLServer JDBC Driver]Object has been closed.

Resolution

When JDBC Query activity was configured to query in subset mode, the resultSet object was kept in the Engine for the next iteration. ResultSet object will only be closed and cleared from the Engine if and only if the there is no more data left. However, since the default Connection Idle Timeout is set to 5 minutes and iteration (to get next subset of rows) would take up to 10 minutes, the connection idled was for more than 5 minutes and was then released. As a result, the next triggering of JDBC Query activity to query the next subset of rows will fail since the connection is now closed and so is the resultSet object.

Set bw.engine.dbConnection.idleTimeout to a higher value, so this connection remains idle without getting released for the next iteration.

Example: java.property.bw.engine.dbConnection.idleTimeout=20

bw.engine.dbConnection.idleTimeout specifies the time (in minutes) to allow database connections to remain idle before closing. You can add it to the deployed .tra (located at <TIBCO_Home>TRA/domain/<domain_name>/application/<application_name>/<app>.tra ) file.