Logical handle no longer valid
We have been seeing this error and I am unable to determine the solution. I have using WebSphere 4.xxx and just upgraded to Oracle 10g. We get a connection from the App Servers pool, unwrap it so we can get access to the OracleConnection class and use it for some spatial queries. Upon completion we close the statement and the original Connection obtained from the pool. Below is some sample code. Does anyone have any insight on this issue? Thanks in advanced.
try {
conn = getConnection(Connection.TRANSACTION_SERIALIZABLE);
OracleConnection oracleConnection = unwrapOracleConnection(conn);
geometry = JGeometry.createLinearPolygon(buildOrdinates(area), GEOMETRY_2D, DEFAULT_SRID);
STRUCT struct = JGeometry.store(geometry, oracleConnection);
statement = oracleConnection.prepareStatement(query);
statement.setBigDecimal(AREA_INDEX, area.getAreaId());
statement.setString(NAME_INDEX, area.getAreaName());
statement.setString(SIC_INDEX, area.getSic());
statement.setObject(SHAPE_INDEX, struct);
statement.setString(DESCRIPTION_INDEX, area.getDescription());
statement.setString(UID_INDEX, userId);
statement.execute();
} finally {
try {
if (statement != null) {
statement.close();
statement = null;
}
} catch (SQLException __e) {
logger.warn(__e.getMessage(), __e);
}
try {
if (conn != null) {
conn.close();
conn = null;
}
} catch (SQLException __e) {
logger.warn(__e.getMessage(), __e);
}
}