Spring-jdbc 5.0.5 NamedParameterJdbcTemplate.batchUpdate ORA-01000

Spring-jdbc 5.0.5 NamedParameterJdbcTemplate.batchUpdate ORA-01000

从 Spring 4.1.7 迁移到 Spring 5.0.5 后,我们遇到 ORA-01000:使用 Oracle 12c 和 ojdbc7 驱动程序时超出最大打开游标数

执行以下代码后引发异常

@SuppressWarnings("unchecked")
private void executeBatch(Map<String, Object>[] updateBatchParams) {
 int[] updateResults = namedJdbcTemplate.batchUpdate(SQL, updateBatchParams);

这个问题与 https://jira.spring.io/browse/SPR-16139 非常相似。

但我们无法更新 ojdbc 驱动程序。

知道如何解决这个问题吗?

P.S。在 Spring jira

中创建了一个 issue

于尔根·霍勒:

There hasn't been any recent work on this. Since this is effectively a bug in the Oracle JDBC driver, I'm afraid we won't be introducing a workaround for an older driver at this point.

You could try setting spring.jdbc.getParameterType.ignore=true as a system property on in a spring.properties file in the root of your classpath, or use spring-jdbc-4.3.17 for the time being... with all other jars set to 5.0.6 (which isn't officially supported but should work fine in practice). I strongly recommend upgrading the JDBC driver though.