title: JPA: Detach a list of attached read-only entities
body: <p>Is it beneficial to detach entities of large lists after querying, i.e. use a default pattern for those entities like:</p>
  
  <pre><code>// Find all
  for List&lt;Device&gt; devices = em.createNamedQuery("find.*.devices", Device.class).getResultList();
  
  // Detach all
  for (Device d : devices) {
    em.detach(d);
  }
  </code></pre>
  
  <p>We could avoid some kinds of negative effects like erroneously update the database for entities considered as "read only" (which could be guaranteed) or save memory.</p>