JpaSystemException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance:

Yunny.Log ·2022년 8월 23일
0

Debugging

목록 보기
40/69
post-thumbnail

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eci.server.CRCOModule.entity.co.ChangeOrder.changeRequests; nested exception is org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eci.server.CRCOModule.entity.co.ChangeOrder.changeRequests] with root cause

org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: eci.server.CRCOModule.entity.co.ChangeOrder.changeRequests

https://stackoverflow.com/questions/60203002/entity-update-causes-error-cascade-all-delete-orphan-was-no-longer-referenced

     this.coEffect.clear();

     this.coEffect = new HashSet<>(); //이 부분이 문제였던 것 

     Set<CoCoEffect> coCoEffectsList =
        
  • 저 중간에 아예 새롭게 set 이나 list 를 할당해주는 부분들을 없애주고, this.coEffect.addAll() 로 더해주어야 하는 것

0개의 댓글