1 Reply Latest reply on Apr 29, 2007 4:29 AM by amit deshpande

    Best Strategy for Deleting 1000's of rows (EJB 2.1)

    Ben Hanney Newbie

      Hi

      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?

      Cheers,
      Ben