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

Document need to exactly match Hibernate's property format when configuring spring.jpa.properties.hibernate.* properties #17975

Closed
TheElk205 opened this issue Aug 27, 2019 · 1 comment
Labels
type: documentation A documentation update
Milestone

Comments

@TheElk205
Copy link

I just figured that the yaml parser is not working as intended. I have this part in my application.yaml

spring:
  profiles: development
  jpa:
    show_sql: true
    database: default
    generate-ddl: false
    properties:
      hibernate:
        order_inserts: true
        generate_statistics: true
        ddl_auto: validate
        jdbc:
          batch_size: 50
          lob:
            non_contextual_creation: true

If I start my applciation now, everything is fine, sql statements are printed and batching is working.
image

If I now change show_sql to showSql everything still works as expected. (double checked it by setting it to false as well, to be sure that it does not get overwritten)

BUT
If I change batch_size to batchSize, sql statements are not batched any more.
image

I am inserting 51 values at a time here.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 27, 2019
@wilkinsona
Copy link
Member

Thanks for the report.

Spring Boot does not know anything about the properties beneath spring.jpa.properties.hibernate. It simply passes them through to Hibernate (with the spring.jpa.properties prefix stripped). This means that the casing of the property hibernate.* portion of the property must match what Hibernate expects.

I'm not sure that there's anything we can do about this at runtime. We can, at least, improve the documentation and describe the need to match Hibernate's expected case in the section on configuring JPA properties.

@wilkinsona wilkinsona changed the title Yaml parser not consistent Document need to exactly match Hibernate's property format when configuring spring.jpa.properties.hibernate.* properties Aug 27, 2019
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 27, 2019
@wilkinsona wilkinsona added this to the 2.1.x milestone Aug 27, 2019
@philwebb philwebb removed this from the 2.1.x milestone Aug 31, 2019
@philwebb philwebb added this to the 2.1.8 milestone Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

4 participants