Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect against getParameterType cursor leak with Oracle 12c JDBC driver [SPR-14629] #19196

Closed
spring-projects-issues opened this issue Aug 25, 2016 · 1 comment

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 25, 2016

Juergen Hoeller opened SPR-14629 and commented

As mentioned in recent comments on #18398, the Oracle 12c JDBC driver has a bug that leads to a cursor leak when getParameterType throws an exception. Our #18398 change in Spring Framework 4.2.5 unfortunately reveals that cursor leak, ironically as a side effect of consistent runtime behavior which implies consistent exposure to that leak :-(

Let's consider a spring.jdbc.getParameterType.ignore default of true for Oracle 12c for the time being.


Affects: 4.2.5, 4.3 GA

Issue Links:

  • #14717 NamedParameterJdbcTemplate for "insert / select" clause, set NULL value causes JConnect 7 (Sybase) problem - java.io.IOException: JZ0SL: Unsupported SQL type 0. - Affects 3.1.3.RELEASE, works in 3.1.1.RELEASE
  • #15018 JdbcTemplate cannot set null parameter with Oracle driver
  • #18764 Regression: Insert statement fails with inconsistent datatypes on Oracle 12c driver
  • #15726 performancedrop due to repeated JDBC 3.0 getParameterType calls in setNull in StatementCreatorUtils
  • #18399 Raise JDBC driver feature baseline to JDBC 4.0+
  • #18398 Oracle 12c JDBC driver throws inconsistent exception from getParameterType (affecting setNull calls)
  • #19143 Avoid repeated getParameterType calls for setNull with Oracle 12c driver
  • #20687 Doc: ParameterMetaData.getParameterType performance on Oracle 12c

Referenced from: commits 52447ef, 2adbfb6

Backported to: 4.2.8

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 26, 2016

Juergen Hoeller commented

Revised for 4.3.3 and 4.2.8 now: StatementCreatorUtils does not use getParameterType on any Oracle driver by default now. If you're on 12c (possibly 12.2 or a custom patch) and would like it to be used, specify spring.jdbc.getParameterType.ignore=false. Since those calls seem to be expensive as well, it is arguably better to only use them when actually needed anyway.

Note that 5.0 is streamlined in this respect: no tracking of drivers without getParameterType support there, and no special exclusion of Oracle drivers either. We essentially expect an up-to-date, fully patched driver at that point (early 2017), in combination with statement pooling. If there are still issues there, the escape hatch remains: spring.jdbc.getParameterType.ignore=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants