|
Hello all,
Got a question regarding the collection that is
returned by container when implementing CMR. In EJB 2.0 spec section
10.3.6.1 states,
" ..................... the Bean
provider must not modify the container-managed collection while the
iteration is in progress in any way that
causes elements to be
added or removed, other than by the java.util.Iterator.remove() method. If
elements are added or removed........
..... the container should
throw the java.lang.IllegalStateException on the next operation on the
iterator"
My question,
In regards to the last sentence (throw the
java.lang.IllegalStateException), If assuming we are developing 2 entity bean (A
& B), bean A is both a remote and local and bean B is only local, where bean
A and bean B has got 1-many relationship and it is a Container Managed
Relationship. The client access bean A and got the result of bean B in a
Collection class, I understand that the collection will be serialized (copied)
to the client, then how is it possible for the container know whether elements
have been added or removed if the collection is not a remote object
?
Thanks a lot for the help.
Cheers
Nanik
|
