{
CVDal cvdl = new CVDal(this.dataSource);
try{
InitialContext ic = CVUtility.getInitialContext();
EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
cvdl.setSqlQuery("SELECT EntityID from entity where list="+listID);
Collection results = cvdl.executeQuery();
if (results != null)
{
Iterator iter = results.iterator();
while (iter.hasNext())
{
HashMap entityList = (HashMap)iter.next();
if (entityList != null)
{
int entityId = ((Number)entityList.get("EntityID")).intValue();
EntityLocal remote = home.findByPrimaryKey(new EntityPK(entityId,this.dataSource));
ctx.getUserTransaction().begin();
remote.remove();
ctx.getUserTransaction().commit();
}
}