Skip to content

Commit

Permalink
Fix usage of clob.free() on MsSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
julienlancelot committed Apr 2, 2015
1 parent c758df0 commit ee7c217
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -234,7 +234,7 @@ private static List<Map<String, Object>> getHashMap(ResultSet resultSet) throws
if (value instanceof Clob) {
Clob clob = (Clob) value;
value = IOUtils.toString((clob.getAsciiStream()));
clob.free();
doClobFree(clob);
} else if (value instanceof BigDecimal) {
// In Oracle, INTEGER types are mapped as BigDecimal
value = ((BigDecimal) value).longValue();
Expand Down Expand Up @@ -435,4 +435,12 @@ private void loadOrchestratorSettings(Settings settings) throws URISyntaxExcepti
IOUtils.closeQuietly(input);
}
}

private static void doClobFree(Clob clob) throws SQLException {
try {
clob.free();
} catch (AbstractMethodError e){
// JTS driver do not implement free() as it's using JDBC 3.0
}
}
}

0 comments on commit ee7c217

Please sign in to comment.