On Sat, Nov 14, 2009 at 4:16 PM, Michael Dick <[email protected]>wrote:
> If I understand the problem correctly the issue exists whether you have a > L2 > cache or not.. Consider the Father -> Child One -> Many relationship. > > If you do something like this : > > Child c = em.find(Child.class, 123); > Father oldFather = c.getFather(); > c.setFather(new Father()); > oldFather.getChildren().contains(c); // will return true > > The caches (L1 or L2) won't be updated until you flush to the database, > even > with InverseManager set. > > Is this the scenario you mentioned? > > I was thinking about two transactions "some time apart" meaning different entity managers. I definitely get that in a single transaction relations are as above. I'm thinking you are editing the father in a web interface and you remove the child. Later you edit the child and it still thinks it has that father. -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:[email protected]
