You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to this, it is OK not to flush explictly, and all changes will be in the database before any future delete or select is triggered in the same transaction.
It could be a change in semantics that a conflict of entries becomes visible only once the transaction is committed.
Still, the old code only caught situations where another transaction has already committed that entry, and situations where concurrent transactions occur can still happen, so removing em.flush() shouldn't break anything that wasn't already broken before.
Description
Looking at
JpaUserSessionPersisterProvider
, there are several explicitem.flush()
statements which hurt performance.Discussion
No response
Motivation
Since Hibernate 5.2 which was published after the code in question was written, Hibernate changed its behavior to automatically flush before a query, see https://vladmihalcea.com/how-do-jpa-and-hibernate-define-the-auto-flush-mode/
Due to this, it is OK not to flush explictly, and all changes will be in the database before any future delete or select is triggered in the same transaction.
It could be a change in semantics that a conflict of entries becomes visible only once the transaction is committed.
Still, the old code only caught situations where another transaction has already committed that entry, and situations where concurrent transactions occur can still happen, so removing
em.flush()
shouldn't break anything that wasn't already broken before.Details
This should not be affected by the orphan removal problem seen in https://hibernate.atlassian.net/browse/HHH-15230
The text was updated successfully, but these errors were encountered: