em.getTransaction().begin();
QueryGenerator generator = new QueryGenerator(AbstractResource.GATEWAY_WORKER);
generator.setParameter(AbstractResource.GatewayWorkerConstants.GATEWAY_NAME,
gatewayResource.getGatewayName());
generator.setParameter(AbstractResource.UserConstants.USERNAME, userResource.getUserName());
Query q = generator.deleteQuery(em);
q.executeUpdate();
em.getTransaction().commit();
em.close();
return true;
} catch (Exception e) {