1

I am facing this error in my entity class.

Found shared references to a collection:com.model.Parts.employees

Below is my code in the Parts model class

@OneToMany

@JoinColumn(name="COMPASS_SKU", referencedColumnName="MANUF_PART_NUM")

private Set<Employee> employees;

How can I get rid of this error?

The stack trace:

ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff87a50a79:-7b13082e:5429d17a:27, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@10da269

: javax.persistence.PersistenceException: org.hibernate.HibernateException: Found shared references to a collection: com.model.Parts.employees at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) [hibernate-entitymanager-4.2.0.Final-redha

Draken
  • 3,134
  • 13
  • 34
  • 54
user3212372
  • 91
  • 2
  • 8
  • 2
    What error your are getting? Please put your error stacktrace code – Gautam Savaliya Sep 29 '14 at 07:57
  • 2
    Probably you are using same employee set in multiple instances of the Parts. Also, probably it's a duplicate. http://stackoverflow.com/questions/1692871/found-shared-references-to-a-collection-org-hibernate-hibernateexception – Petar Butkovic Sep 29 '14 at 08:09

0 Answers0