title: Mybatis query returning incorrect results. Possible caching issue?
body: <p>I have a JUnit test, which includes use of Mybatis. At the start of the test I'm retrieving a count of records in the table.</p>
  
  <p>At the end of the test I expect an additional record to be present in the table, and have an assert to verify this condition. However I find that the second query returns exactly the same number of records as the first one did.</p>
  
  <p>I know a new record has definitely been inserted in the table.</p>
  
  <p>I thought this may be related to caching, so I tried flushing all caches associated with the session. I also tried using <code>setCacheEnabled(false)</code>, but still the same result.</p>
  
  <p>Here's my code fragment -</p>
  
  <pre><code>@Test
  public void config_0_9() {
      session.getConfiguration().setCacheEnabled(false);
      cfgMapper = session.getMapper(CfgMapper.class);
      int oldRecords = cfgMapper.countByExample(null);
  
      messageReprocessor.processSuspendedMessages();
      session.commit();
  
      int newRecords = cfgMapper.countByExample(null);
      assertTrue(newRecords == oldRecords + 1);
  }
  </code></pre>