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

Comments

@TheElk205
Copy link

commented Aug 27, 2019

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.

@wilkinsona

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

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 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 closed this in 6ca9241 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
Projects
None yet
4 participants
You can’t perform that action at this time.