Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] lazy loading overrides attached object

Check that you have not done a refresh on B and that the mappings involved are not marked to cascade the refresh.  If B was refreshed by any means, it will cascade over to the A when the relationship is triggered, which will in turn cascade the refresh over the relationship of Bs if it has also been set, wiping out changes.

If this is occurring, do not use cascade refresh or cascade all settings on the affected mappings, especially lazy mappings.

On 2013-06-13, at 5:28 PM, Michael Hoennig <michael@xxxxxxxxxx> wrote:

> Hi everybody,
> 
> Ever anybody had such a situation:
> 
> - A with @OneToMany EAGER to B
> - B with @ManyToOne LAZY to A
> (yes, other than usual, but with good reason in this case)
> 
> And now this situation:
> - some B is retrieved separately, modified and still attached
> - now we navigate to its A, thus all B are loaded EAGERLY
> - this loading includes the B which is still attached
> - and the modification is overridden by the EAGER loading!
> 
> Thanks for any hints!
> ... Michael
> 
> -- 
> http://michael.hoennig.de
> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top