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

GenericTableMetaDataProvider could use non standard named TableMeta-Schema if only one found [SPR-15090] #19656

Closed
spring-projects-issues opened this issue Jan 4, 2017 · 1 comment
Assignees
Labels
in: core type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jan 4, 2017

Uwe Grünheid opened SPR-15090 and commented

Use Case

  1. Postgres 9.5 accessed via spring DatabaseBuilder and URL including currentSchema(since Postgres 9.4)
  2. Spring Batch accessing database using spring jdbc (JdbcTemplate, etc)
  3. SimpleJdbcInsert using doExecuteAndReturnKey(SqlParameterSource parameterSource)

Problem

  1. method locateTableAndProcessMetaData fills tableMeta with schema from given table (see on picture)
    • tmd.setSchemaName(tables.getString("TABLE_SCHEM")); (line. 308)
  2. Afterwards fetching tableMeta fails because it checks for default schema or known database schemas like PUBLIC or DBO
  3. DataAccessResourceFailureException is thrown

Improvement

If no standard schema fits and tableMeta has size 1 use the schema found by selecting table meta data.


Affects: 4.2.6

Reference URL: https://github.com/spring-projects/spring-framework/blob/4.2.x/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java

Attachments:

Referenced from: commits de7eea4, de43497

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 12, 2017

Uwe Grünheid commented

Thanks for fast handling ;)

@spring-projects-issues spring-projects-issues added type: enhancement in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants