Closed
Description
Adam Sojka opened SPR-16139 and commented
After upgrading from Spring 4.3 to 5.0.1 the NamedParameterJdbcTemplate.batchUpdate call results in an exception ORA-01000: maximum open cursors exceeded when using with Oracle 12c.
The batchUpdate is updating batches of 250 records.
The applications code hasn't changed in method where exception is being thrown.
@SuppressWarnings("unchecked")
public int[] saveBatchOutputs(final String updateSql, final List<Map<String, Object>> batchValuesList) {
Map<String, Object>[] batchValues = new Map[batchValuesList.size()];
batchValues = batchValuesList.toArray(batchValues);
return namedParameterJdbcTemplate.batchUpdate(updateSql, batchValues);
}
In the method the updateSql is predefined and the batchValuesList is up to 250 elements in size.
Affects: 5.0.1
Issue Links:
- "Parameter metadata not available for the given statement" SQL Exception after upgrading to Spring 5.0 RC4 [SPR-15977] #20528 "Parameter metadata not available for the given statement" SQL Exception after upgrading to Spring 5.0 RC4
- Raise JDBC driver feature baseline to JDBC 4.0+ [SPR-13826] #18399 Raise JDBC driver feature baseline to JDBC 4.0+
- Protect against getParameterType cursor leak with Oracle 12c JDBC driver [SPR-14629] #19196 Protect against getParameterType cursor leak with Oracle 12c JDBC driver
- We are facing the maximum open cursor issue [SPR-17001] #21539 We are facing the maximum open cursor issue
- Spring-jdbc 5.0.5 NamedParameterJdbcTemplate.batchUpdate ORA-01000 [SPR-16814] #21354 Spring-jdbc 5.0.5 NamedParameterJdbcTemplate.batchUpdate ORA-01000
- SqlParameterSourceUtils.createBatch with Collection support [SPR-16215] #20763 SqlParameterSourceUtils.createBatch with Collection support
Referenced from: commits daee6ee