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

CallMetaDataContext.reconcileParameters doesn't catch output parameters with DatabaseMetaData.procedureColumnResult type (on Postgres) [SPR-16611] #21152

spring-projects-issues opened this issue Mar 19, 2018 · 1 comment
in: data status: backported type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Mar 19, 2018

Ivan Vasilev opened SPR-16611 and commented

I added a comment here but I think, it'll be better to create a new issue.

I use spring-jdbc with postgres driver. To call stored procedure which returns a table row, I use the following code:

        MapSqlParameterSource params = new MapSqlParameterSource()
                .addValue("in_id", name);

        Map<String, Object> resultMap = new SimpleJdbcCall(jdbcTemplate)

It produces following exception:

org.springframework.dao.InvalidDataAccessApiUsageException: Required input parameter 'id' is missing
at org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(
at org.springframework.jdbc.core.JdbcTemplate.execute(
at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(
at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(
at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(
at com.example.demo.DemoApplicationTests.callProcedure(

It wants me insert an output parameter.

I searched a little and found following:

  • PgDatabaseMetaData returns java.sql.DatabaseMetaData.procedureColumnResult.
  • CallMetaDataContext doesn't check parameter type for equality to this value. It checks for DatabaseMetaData.procedureColumnReturn only.

I created a sample project (in attachment). It uses Flyway to initialize and Testcontainers to use real postgres db. Change driver name and url if you do not want to use docker.

Affects: 4.3.13


Issue Links:

  • #21099 PostgresTableMetaDataProvider.isGetGeneratedKeysSimulated() does not detect Postgres 10
  • #21250 SimpleJdbcCall with rowMapper set fails on execution (on Postgres)

Referenced from: commits b7c4238, 301ba01

Backported to: 4.3.15

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 19, 2018

Juergen Hoeller commented

This is in master now, becoming available in the upcoming 5.0.5.BUILD-SNAPSHOT. I'll backport it to 4.3.15 tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: data status: backported type: bug
None yet

No branches or pull requests

2 participants