Are you returning the same Set instance from the getter method that Hibernate set on the setter method? Eg.
Code:
public void setSomething(Set something)
{
this.something = something;
}
public Set getSomething()
{
return something;
}
I have seen lots of examples of people doing copies of sets with, for example, the Set.addAll() method and other variants. This makes Hibernate to assume that it's dirty and Hibernate can in the worst case first delete all relations, and the re-create them again. My advice is that you turn on some logging to see what is going on. If you still can't figure things out, please submit relevant mappings documents and parts of your code.