The method {{org.hibernate.engine.internal.EntityEntryContext#reentrantSafeEntityEntries}} is allocating a defensive copy of the data structure for iteration, but this has been shown as not being very efficient in terms of memory allocations.
We should explore alternatives, especially as IThere’ve noticed since ORM 6s some code that indeed requires this defensive step, but the clear method on StatefulPersistenceContext is now only used by also using it; I’ll be adding a single path: optimised version of the Session#clear() method which is better suited for such operations. Hopefully that simplifies things. |
|