title: Entity must be managed to call remove?
body: <pre><code>public Person deletePerson(Person entity) {
      EntityManager ems = emf.createEntityManager();
  
      try {
          ems.getTransaction().begin();
          ems.merge(entity);
          ems.remove(entity);
          ems.getTransaction().commit();
      } finally {
          ems.close();
      }
      return entity;
  }
  </code></pre>
  
  <p>it doesnt work I don't know why?  Gives me <code>java.lang.IllegalArgumentException</code></p>