I do have a system running on Apache tomcat 7 (7.0.34 if that makes any difference) with a mapping with a property like this
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST,CascadeType.MERGE})
@JoinTable(name = "device_document",
joinColumns = {@JoinColumn(name = "device_id", referencedColumnName = "device_id")},
inverseJoinColumns = @JoinColumn(name = "document_id", referencedColumnName = "id"))
public Set<Document> getDocuments() {
return documents;
}
When I do call to my save function it works nice, but after some time the exact same code, with the exact same data throws an exception
unsaved transient instance - save the transient instance before flushing
And it keeps throwing that exception everytime I try to save the instance until (sometimes) I restart the tomcat service.
Do you have any idea about why is this happening?