This content has been marked as final.
Show 4 replies
-
1. Re: Deleting while iterating over a collection
fbiaggi Jun 7, 2005 12:07 PM (in response to dumbledore)Hi,
NO, you are removing an instance of the Iterator... -
2. Re: Deleting while iterating over a collection
dumbledore Jun 7, 2005 12:35 PM (in response to dumbledore)Thanks for the reply.
Okay, so this iterator doesn't behave as described in the java-api-docs? The iterator is of the type java.util.Iterator.
Where can I learn more about this topic?
Regards
D. -
3. Re: Deleting while iterating over a collection
schmidts Jun 7, 2005 3:54 PM (in response to dumbledore)"Dumbledore" wrote:
Thanks for the reply.
Okay, so this iterator doesn't behave as described in the java-api-docs? The iterator is of the type java.util.Iterator.
Where can I learn more about this topic?
EJB spec, section 10.3.6 gives more details.
BTW, there's a subtle yet big difference between your two code examples:
first example: removes all players from the "players" collection belonging to the given "game". the player objects still continue to exist.
second example: physically removes all player objects belonging to the given "game". thus automatically removing them from the collection, too.
(sorry, no idea why the first example doesn't work) -
4. Solved: Deleting while iterating over a collection
dumbledore Jun 8, 2005 1:39 AM (in response to dumbledore)Thanks, that's it! Removing an object from the iterated collection means deleting the relation, but not the related object.
Regards,
D.