I have a bidirectional many-to-many class:
public class A{
@ManyToMany(mappedBy="listA")
private List<B> listB;
}
public class B{
@ManyToMany
private List<A> listA;
}
Now I save a listA into B:
b.setListA(listA);
This all works fine until I turn on second-level caching on the collection a.ListB. Now, when I update the list in B, a.listB does not get updated and remains stale.
How do you get around this?
Thanks, Dwayne