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-issuemaster opened this issue Jan 4, 2017 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 12, 2017

Uwe Grünheid commented

Thanks for fast handling ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.