5

I have recently upgraded my project from Spring Framework 4.3.10 to 5.0.1. After the upgrade the namedParameterJdbcTemplate.batchUpdate started to fail with this error

ORA-01000: maximum open cursors exceeded.

The batch updates 250 records a time which has not changed and was working fine with Spring 4.3.x.

Has anyone came across a similar issue with Spring 5.0.1 ?

I haven't seen any changes in the Spring documentation related to usage of batchUpdate.

Any clues or is it a candidate for jire issue.

I have rolled back spring-jdbc alone to version 4.3.10 which resolved the issue. I have also raised a Jira regression defect https://jira.spring.io/browse/SPR-16139

2

2 Answers 2

3

After exchanging information via Spring JIRA ticket the following resolved the issue:

  1. Upgrading to the latest Oracle JDBC driver 12.2.0.1 (ojdbc8.jar)
  2. Creating spring.properties file with entry:spring.jdbc.getParameterType.ignore=true

The Oracle driver upgrade resolves the cursor leaking issue. The spring.properties file resolves performance issue with spring-jdbc version 5.0.1.

I expect that there will be some changes in spring-jdbc 5.0.2 that will resolve the issue without having to create custom spring.properties file.

The issue was resolved thanks to Juergen Hoeller from Spring team.

2
  • is there a spring bug/ticket where they resolved it?
    – kosta5
    Aug 14, 2020 at 7:49
  • Where do we need to create the spring.properties ?
    – Prateek
    Aug 26, 2020 at 9:14
1

Yes the issue was resolved in Spring 5.0.2:

https://github.com/spring-projects/spring-framework/issues/20687

1
  • The spring.properties needs to be added to resources folder. At the same time in spring boot the entry would need to be added to existing application.yaml. With newer version of Spring I don't think the issue is present.
    – Adam Sojka
    Aug 28, 2020 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.