title: Bulkupdate Cache issue? Hibernate / IntegrationTest / Inmemory DB /
body: <p>For my Integration tests I am using a HSQLDB-Inmemory. </p>
  
  <p>When i execute a bulk update via jql query I am not able to get the updated results afterwards.</p>
  
  <p>Entity.class</p>
  
  <pre><code>@Entity
  public class Entity {
     private Long id;
     private String someCriteria;
     private Boolean changed = Boolean.FALSE;
  
     @Id
     @Column (name = "ID")
     public Long getId() {
        return id;
     }
  
     @Column (name = "SOMECRITERIA")
     public String getSomeCriteria() {
        return someCriteria;
     }
  
     @Column (name = "CHANGED")
     @Type (type = "yes_no")
     public String isChanged() {
        return changed;
     }
  
     […]
  }
  </code></pre>
  
  <p>DataStore.class
  […]</p>
  
  <pre><code>@Transactional
  updateChangedMethod() {
  Query query = entityManager.get().createQuery(“UPDATE Entity e SET e.changed = true WHERE (d.someCriteria = ‘true’) ");
  query.executeUpdate();
  }
  
  @Transactional
  selectAllMethod() {
  Query query = entityManager.get().createQuery("Select e from Entity e", Entity.class);
  }
  […]
  </code></pre>
  
  <p>Service.class</p>
  
  <pre><code> execute(){
          updateChangedMethod() ;
          selectAllMethod(); // Results do not contain the update
      }
  </code></pre>
  
  <p>When I execute a refresh for each entity explicitly the select works as expected:</p>
  
  <pre><code> @Transactional
      refresh(){
      Query query = entityManager.get().createQuery("Select e from Entity e",  Entity.class);
      List&lt;Entity&gt; result = query.getResultList();
  
      for (Entity entity : result) {
          entityManager.get().refresh(entity);
      }
      }
  
  
     execute(){
              updateChangedMethod() ;
              refresh();
              selectAllMethod(); // Results do contain the update
        }
  </code></pre>
  
  <p>I am using Hibernate v 5.1.0.Final and HSQLDB v 2.3.4.
  I assume that this is a Cache issue, is there a way to receive the expected results directly without calling a refresh on each entity? </p>