title: JPA EntityManager with Hibernate - find and remove does not delete data from database
body: <p>Having trouble getting the following code to work...</p>
  
  <p>I've got a <code>JpaTransactionManager</code> <code>txManager</code> autowired into this test. I know record with ID 39 <em>does</em> exist. It still exists at the end of the transactions, too...</p>
  
  <pre><code>    TransactionStatus status = txManager.getTransaction(def);
      A a = mock(A.class);
      when(a.getId()).thenReturn(Long.valueOf(39));
      sut.delete(a);
      txManager.commit(status);
  
      status = txManager.getTransaction(def);
      a = sut.get(a.getId());
      txManager.commit(status);
  
      assertNull(a);
  </code></pre>
  
  <p>Code in class <code>A</code>:</p>
  
  <pre><code>public void delete(A a) {
  
      a = getEntityManager().find(A.class, a.getId());
      getEntityManager().remove(a);
  
  }
  </code></pre>
  
  <p>Is there any reason the above assertNull check <em>always</em> fails? I cannot delete the object from my system no matter what I do - no error returned, and no issue with the delete reported. (As an aside, running a query directly in HQL <em>does</em> result in an update of the database...I just can't get it to work using the delete method supplied using JPA...)</p>
  
  <p>Any assistance appreciated</p>