title: How to avoid caching of entites in Spring Repository during a Transaction for tests
body: <p>I have a Test like this:</p>
  <pre><code>@Transactional
  @Test
  public void addRemoveTest() {
      MyEntitiy entity = new MyEntitiy ();
  
      entity = textureRepository.saveAndFlush(entity );
      TestTransaction.flagForCommit();
      TestTransaction.end();
      TestTransaction.start();
      final MyEntitiy loadedTexture = myEntityRepository.findOne(entity .getId());
  }
  </code></pre>
  <p>This works perfectly fine. But when I remove the Committing code for the transaction, the repository will not call the database when calling <code>findOne()</code>. Can I somehow force it to make the database call for my tests?</p>
  <p>I prefer my test to not commit any transaction.</p>
  <p>I'm not able to get the <code>Session</code> to clear the cache. And I'm not even sure if clearing the session would help.</p>