Can anyone suggest the best way to delete large numbers of rows from a table using EJB 2.1?
Obviously you can implement a findAll method and then loop through each Entity calling remove() but surely there must be a better way from a performance perspective?
I had tried implementing a home business method combined with an ejbSelect containing a DELETE statement until I realized EJBQL in EJB 2.1 doesn't support DELETE's!
This issue seems to have been addressed in EJB 3.0 and Hibernate but if your stuck with EJB 2.1 what is the best strategy? Is it just to write some JDBC or is there a better more 'EJB' way to do it?
If you have read Ejb are more expensive than plain Jdbc quires at any case so for purposes like listing and deleting, modifying, inserting large number of records one should always use plain jdbc quires as you will get a large performance gain over ejbs.