0

Exception

org.springframework.orm.jpa.JpaSystemException: Found shared references to a collection: lk.pwc.projects.rdd.rims.entitymanagement.domain.common.Land.deedList; 
nested exception is org.hibernate.HibernateException: Found shared references to a collection: lk.pwc.projects.rdd.rims.entitymanagement.domain.common.Land.deedList

Snippet Causing the issue

    @ElementCollection(fetch = FetchType.LAZY)
    @CollectionTable(name = "land_application_upload_deed", joinColumns = @JoinColumn(name = "land_application_id"))
    private Set<LandDeed> deedList;

Above Mapping throwing the error

Avi
  • 1,458
  • 9
  • 14
avishka eranga
  • 105
  • 1
  • 11

1 Answers1

2

This thing happened whenever you reinitialize your collection property. In your case, it is "deedList". Instead of reinitializing it, just clear it and add new elements in it.

chirag
  • 53
  • 6