From: Doug C. <de...@fl...> - 2002-02-23 18:00:15
|
<snip> > Suppose the application passes a subset to hibernate to persist. Hibernate > wraps it up and tracks changes to it by catching invocations on the > wrapper. The application might later on (in the same Session, but after a > flush) change the original set, which changes the subset. But hibernate > wouldn't know. Well, unfortunately it sometimes _would_ know. Which makes > the behaviour very undefined. If we _copy_ the original subset, then at > least we know that changes to the original set will _never_ be reflected > in the persistent set. The current implementation using addAll() is only a shallow copy, so changes to the composition of the set aren't reflected in the copy, but changes to mutable elements are visible in both. I guess user should expect that!? e |