-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
HHH-13677 Make org.hibernate.flushMode config take effect #3144
Conversation
cf49cb0
to
8affd32
Compare
8affd32
to
0be6442
Compare
Thank you, guys! |
@@ -256,6 +256,8 @@ public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) { | |||
// NOTE : pulse() already handles auto-join-ability correctly | |||
getTransactionCoordinator().pulse(); | |||
|
|||
getSession().setHibernateFlushMode( ConfigurationHelper.getFlushMode( getSessionProperty( AvailableSettings.FLUSH_MODE ), FlushMode.AUTO ) ); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sanne should we add the FlushMode
to the FastSessionServices
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, FastSessionServices
contains FlushMode
default value. If you drill down the getSessionProperty()
you can see it will look up in FastSessionServices
by default. The FlushMode.AUTO
above will never take effect for FastSessionServices
should have returned a non-null value for AvailableSettings.FLUSH_MODE
:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, looks good. Is something not working as expected @dreab8 ? Feel free to add tests :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't noticed that getSessionProperty
takes the value from the FastSessionServices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum both ConfigurationHelper#getFlushMode
and the getSessionProperty
methods are rather slow though. I see what @dreab8 meant now, I will add an additional fix to this.
Applied upstream. |
https://hibernate.atlassian.net/browse/HHH-13677
We ignored setting flush mode during session building. This PR simply grabs the setting from
fastSessionService
. Testing case added.