title: How to check (debug) if JPA query get result from cache or from database
body: <p>I have simple JPA query</p>
  
  <pre><code>  Query query = getEntityManager().createQuery("SELECT pn FROM ProductsNames pn"
              + " WHERE pn.languages = :language"
              + " ORDER BY pn.products.id ASC");
      query.setParameter("language", language);
    return query.getResultList();
  </code></pre>
  
  <p>How can I check if result of these method return the list of objects from cache or direct from database?</p>
  
  <p>in persistence.xml I have set the following paramter:</p>
  
  <pre><code> &lt;property name="eclipselink.logging.level.sql" value="FINE"/&gt;
  </code></pre>
  
  <p>so on output of server I can monitor executed queries (but Im not sure of that  - if query are visible on output that`s mean the query was sent to database or that mean the query was sent to entityManager and entityManager decide to use cache and later sent query to database).</p>
  
  <p>So how I can distinguish which result of object are from:</p>
  
  <ul>
  <li>direct from database</li>
  <li>direct from cache</li>
  </ul>
  
  <p>I Will grateful for help.</p>