Skip to content

Commit

Permalink
0001468: Sync triggers on Oracle: Maximum open cursors exceeded. clos…
Browse files Browse the repository at this point in the history
…ed on more result set. didn't seem to make a difference.
  • Loading branch information
chenson42 committed Nov 20, 2013
1 parent 5ce2e5c commit e7e8a9e
Showing 1 changed file with 18 additions and 15 deletions.
Expand Up @@ -1217,22 +1217,25 @@ protected void determineAutoIncrementFromResultSetMetaData(Connection conn, Tabl
"Running the following query to get metadata about whether a column is an auto increment column: \n{}",
query);
}
ResultSet rs = stmt.executeQuery(query.toString());
ResultSetMetaData rsMetaData = rs.getMetaData();
ResultSet rs = null;
try {
rs = stmt.executeQuery(query.toString());
ResultSetMetaData rsMetaData = rs.getMetaData();

for (int idx = 0; idx < columnsToCheck.length; idx++) {
if (log.isDebugEnabled()) {
log.debug(columnsToCheck[idx] + " is auto increment? "
+ rsMetaData.isAutoIncrement(idx + 1));
}
if (rsMetaData.isAutoIncrement(idx + 1)) {
columnsToCheck[idx].setAutoIncrement(true);
for (int idx = 0; idx < columnsToCheck.length; idx++) {
if (log.isDebugEnabled()) {
log.debug(columnsToCheck[idx] + " is auto increment? "
+ rsMetaData.isAutoIncrement(idx + 1));
}
if (rsMetaData.isAutoIncrement(idx + 1)) {
columnsToCheck[idx].setAutoIncrement(true);
}
}
} finally {
close(rs);
}
} finally {
if (stmt != null) {
stmt.close();
}
close(stmt);
}
} catch (SQLException ex) {
StringBuilder msg = new StringBuilder(
Expand Down Expand Up @@ -1339,7 +1342,7 @@ public List<String> execute(Connection connection) throws SQLException {
}
return schemas;
} finally {
JdbcSqlTemplate.close(rs);
close(rs);
}
}
});
Expand All @@ -1361,7 +1364,7 @@ public List<String> execute(Connection connection) throws SQLException {
}
return list;
} finally {
JdbcSqlTemplate.close(rs);
close(rs);
}
}
});
Expand All @@ -1382,7 +1385,7 @@ public List<String> execute(Connection connection) throws SQLException {
}
return list;
} finally {
JdbcSqlTemplate.close(rs);
close(rs);
}
}
});
Expand Down

0 comments on commit e7e8a9e

Please sign in to comment.