Detach before replacing features collection in /org/domain

FixSecurityService
Ya
21 Mei 2026, 20:55 UTC
Mwandishi
Kamo
Ahadi ya
25d1694

The previous fix wired the applied-model projection into **************** but called org.setFeatures(projected) on the still-managed entity. The Organization.features @OneToMany has cascade=all-delete-orphan, so Hibernate fired its "A collection with cascade='all-delete-orphan' was no longer referenced by the owning entity instance" guard and 500'd every request — leaving the kamo-internal SSR layout still falling back to the no-POS feature list. Net effect: the ambiguous-handler fix landed but the user kept seeing no Commerce nav. - Compute the projection BEFORE detaching (enforcement may still need lazy relations). - entityManager.flush() to commit auto-provision INSERTs. - entityManager.detach(org) to take it out of the persistence context. - THEN org.setFeatures(new ArrayList<>(projected)) on the detached instance — safe because Hibernate is no longer tracking the collection. - @PersistenceContext EntityManager added as a private field. Auto-provision and projection are still wrapped in try/catch so a stale or half-configured applied model can't take down the org-fetch.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei