Hey there everyone ...
I´m using JPA with SPRING and mySQL and I´m having problems while removing an entity...
I am doing this:
@PersistenceContext
private EntityManager em;
... @Transactional
public void delete(Long id) {
em.flush();
OwnerEntity e = em.getReference(Entity.class, Long.valueOf(id));
if (e == null)
throw new Exception(Status.SERVER_ERROR);
em.remove(e);
em.flush();
}