Hi All.. Here is what I am trying to achieve.. I have my application that uses entity beans as ORM. I am trying to bulk delete rows of a very large table, via entity bean CMP. I understand that the code would look something like this...,
In my case, the collection rowsToDelete (which would be populated by a finder) would have close to a million records. Would this create as many objects in the EJB pool? Would'nt this exhaust my EJB container's heap? Is this why the docs advise against the usage of findAll()..
For your info, I use JBoss 6.0.0 with EJB 2.0. If bulk delete such as the above is problematic, I am looking for a way to fetch only a limited number of records, say 500 iteratively and delete records. As far as I checked, this option is available in EJB 3.0 but not in EJB 2.0. So, how do I accomplish a delete in this case. Any ideas or pointers are appreciated.