Hello list,

I am fetching a "List" of objects (a too many relationship).

Then in a loop, I am removing some objects:

          List<RegistryCenter> rcs = getRegistry().getRegistryCenters();
          List centers = getSelectedCountry().getCenters();
          for(RegistryCenter rc:rcs)
            {
                centers.remove(rc.getCenter());
            }


Now, this doesn't always work. Actually, it fails if "centers" is a fault (I 
checked in the Cayenne code).

If I simply do a "size()" of "contains" on the list before my loop for example. 
My list will fire and my loop will function correctly, removing objects when 
present in the list.

So there is a workaround, but I was wondering why the "remove(object)" in  
ToManyList.java behaved differently than for example "remove(index)" which will 
correctly fire the fault.

In other words, "remove(object)" is the only function which does not 
systématically fire the fault.

Why?

Thanks,

Alex

Reply via email to