KamoCRM

Mutate features collection in-place to avoid cascade orphanRemoval error

Fixkamo-shared-library
Shipped
18 ஏப்ரல், 2026 அன்று 7:19 PM UTC
Author
Kamo
Commit
79d22ff

Calling org.setFeatures(newList) replaces the Hibernate-tracked persistent collection, causing JpaSystemException when any query triggers auto-flush in an open EntityManager session (OpenEntityManagerInView). Mutating the existing collection with clear()+addAll() preserves the tracked reference.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing