public Cliente getCliente(Integer id) throws DAOException {
try {
return em.find(Cliente.class, id);
} catch (PersistenceException e) {
LOG.debug("ERRO: "+e.getMessage());
throw new DAOException(e);
}
}
public void excluir(Cliente cliente) throws DAOException {
try {
em.remove(cliente);
} catch (PersistenceException e) {
LOG.debug("ERRO: "+e.getMessage());
throw new DAOException(e);
}
}
Cliente c = cliente = cdao.getCliente( 1 );
cdao.excluir©;
ai quando vou excluir da essa exception
javax.ejb.EJBException: java.lang.IllegalArgumentException: Removing a detached instance
alguem sabe por q?