title: JPA: query not fetching the latest data
body: <p>I'm finding that JPA is not fetching the latest data from the database.</p>
  
  <p>My data model has a customer entity that owns a number of order entities.  I'm persisting an order:</p>
  
  <pre><code>em.persist(order);
  em.getTransaction().commit();
  em.close();
  </code></pre>
  
  <p>To view the orders, I call:</p>
  
  <pre><code>Collection&lt;Order&gt; orders = customer.getOrderCollection();
  </code></pre>
  
  <p>The orders collection is missing the latest order.  I've checked and the order is persisted to the database.  With the driver logging turned on, I don't see any calls to the database when getOrderCollection() is called.</p>
  
  <p>In Netbeans 6.9, when I stop &amp; redeploy the app, I see the latest order that I persisted appear.  So perhaps there's some sort of caching that may be interfering with getOrderCollection()?  For some reason, JPA is not going to the database.  Why?</p>
  
  <p>How can I force JPA to go to the database when getOrderCollection() is called?</p>