hibernate-orm
hibernate-orm copied to clipboard
Updated documentation as per Jira HHH-15049
Thanks for your pull request!
This pull request appears to follow the contribution rules.
› This message was automatically generated.
It would be great to tweak your git commit message to start with "HHH-15049".
@NathanQingyangXu - Updated commit message to start with HHH-15049
@NathanQingyangXu - Updated commit message to start with
HHH-15049
@beikov could you take a look? Seems a good catch!
This is a bit more complicated I think as the default value depends on whether Hibernate is bootstrapped via JPA or via the Hibernate native boot API.
The default value for JPA boot is false
as you can see here: https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L256
Whereas true
for Hibernate native boot as you can see here: https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L320
So IMO we should adapt the documentation to make this clear. Wdyt @sebersole and @dreab8?
@beikov yeap I agree with you that it would be better if the documentation mentioned that for JPA boot this setting is ignored and the value is always false.
Make sense @beikov @dreab8. In that case should the current be updated as below?
*hibernate.transaction.flush_before_completion* (e.g.
trueor
false(Hibernate bootstrap with JPA value will be false) )::
This is a bit more complicated I think as the default value depends on whether Hibernate is bootstrapped via JPA or via the Hibernate native boot API.
The default value for JPA boot is
false
as you can see here: https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L256Whereas
true
for Hibernate native boot as you can see here: https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L320So IMO we should adapt the documentation to make this clear. Wdyt @sebersole and @dreab8?
I saw it is set to TRUE by default in https://github.com/hibernate/hibernate-orm/blob/9e9a8135dc705a7fc5e5154e89fd11465f5f6589/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L320
Is it true that the default value depends on whether it is in JPA boot mode or Hibernate mode?
Make sense @beikov @dreab8. In that case should the current be updated as below?
*hibernate.transaction.flush_before_completion* (e.g.
trueor
false(Hibernate bootstrap with JPA value will be false) )::
Hold on. I think the configuration we are talking about is Hibernate specific and it should be TRUE by default; for JPA compliance configuration, we have a separate suite. Maybe we need to add a new entry as following in the JPA Compliance section (https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#configurations-jpa-compliance) and set its default value to FALSE.
- hibernate.jpa.compliance.transaction.flush_before_completion
@sebersole how do you think?
@NathanQingyangXu for Jpa bootsrapping the EntityManagerFactoryBuilderImpl
is executed first and then SessionFactoryOptionsBuilder
so the value of flushBeforeCompletionEnabled
is always false
Thanks for letting me know. So the default value is true for non-jpa boot, right? Should we update the doc and how?
On Thu., Apr. 28, 2022, 4:17 a.m. Andrea Boriero, @.***> wrote:
@NathanQingyangXu https://github.com/NathanQingyangXu for Jpa bootsrapping the EntityManagerFactoryBuilderImpl https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L256 is executed first and then SessionFactoryOptionsBuilder https://github.com/hibernate/hibernate-orm/blob/9e9a8135dc705a7fc5e5154e89fd11465f5f6589/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L320 so the value of flushBeforeCompletionEnabled is always false
— Reply to this email directly, view it on GitHub https://github.com/hibernate/hibernate-orm/pull/4898#issuecomment-1111886725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6UYAR7YFHJWYQD7F7KLKDVHJCSJANCNFSM5RMELPAQ . You are receiving this because you were mentioned.Message ID: @.***>
Maybe I misunderstood. Anyway.
On Thu., Apr. 28, 2022, 12:24 p.m. Nathan Xu, @.***> wrote:
Thanks for letting me know. So the default value is true for non-jpa boot, right? Should we update the doc and how?
On Thu., Apr. 28, 2022, 4:17 a.m. Andrea Boriero, < @.***> wrote:
@NathanQingyangXu https://github.com/NathanQingyangXu for Jpa bootsrapping the EntityManagerFactoryBuilderImpl https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L256 is executed first and then SessionFactoryOptionsBuilder https://github.com/hibernate/hibernate-orm/blob/9e9a8135dc705a7fc5e5154e89fd11465f5f6589/hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java#L320 so the value of flushBeforeCompletionEnabled is always false
— Reply to this email directly, view it on GitHub https://github.com/hibernate/hibernate-orm/pull/4898#issuecomment-1111886725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6UYAR7YFHJWYQD7F7KLKDVHJCSJANCNFSM5RMELPAQ . You are receiving this because you were mentioned.Message ID: @.***>