[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Best Strategy for Deleting 1000's of rows (EJB 2.1)

brdh2007 do-not-reply at jboss.com
Mon Apr 23 06:58:45 EDT 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039788#4039788

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039788



More information about the jboss-user mailing list