title: JPA: Deleting detached instance
body: <p>I get resultList from typedQuery object.
  I take first object from that list. </p>
  
  <p>eg. <code>LoginAttempt loginAttempt = loginAttempts.get(0);</code>  </p>
  
  <p>When, I update this object and call <code>entityManager.merge(loginAttempt);</code> it is updated successfully.</p>
  
  <p>But when I am going to delete this object it gives me exception ie. <code>java.lang.IllegalArgumentException: Removing a detached instance.</code></p>
  
  <p>Any suggestion. Thanks :)</p>
  
  <p>Actually, I want to remove only. I just mention merge because, I am get confused that merge is working but remove is not working...</p>