Found-shared-references-to-a-collection

In one of my entity I did map using referencedColumnName as below before it was working
after upgrading hibernate search 5.8.0.Final getting error for translations:

@Column(name=“task_outcome”, length=64, updatable=false)
private String outcome;

@OneToMany
@JoinColumn(name=" key ", referencedColumnName=“task_outcome”, insertable=false, updatable=false)
private Set translations;

ERROR ::
Found shared references to a collection: com.eurodyn.eips.core.db.entity.HistoryTask.translations; nested exception is org.hibernate.HibernateException: Found shared references to a collection: .core.db.entity.HistoryTask.

My configuration as below :

<hibernate.entitymanager-version>5.2.11.Final</hibernate.entitymanager-version>
<hibernate.search-version>5.8.0.Final</hibernate.search-version>

   <dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate-entitymanager</artifactId>
	<version>${hibernate.entitymanager-version}</version>
</dependency>

<dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate-search-backend-jms</artifactId>
	<version>${hibernate.search-version}</version>
</dependency>
<dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate-search-orm</artifactId>
	<version>${hibernate.search-version}</version>
</dependency>
<dependency>
	<groupId>org.hibernate</groupId>
	<artifactId>hibernate-search-serialization-avro</artifactId>
	<version>${hibernate.search-version}</version>
</dependency>

Hello any solution on how to resolve this issue…thank you

The problem with “shared references” is that you seem to have multiple associations that map to the same join table through the same key. In such a scenario, Hibernate is unable to determine the source it should use for synchronizing to that join table for that key. I guess that since “outcome” is not unique and you loaded two entities referring to the same outcome you run into such a situation. You will have to add a unique constraint for the task_outcome column.