title: Howto reduce partial-flushes
body: <p>I have a quite simple java application using Hibernate as ORM framework.</p>
  
  <p>That application does fetch (in a single transaction) a few thousand objects from the db and returns them. There are no updates on these entities.</p>
  
  <p>The hibernate stats shows me the following:</p>
  
  <pre><code>Session Metrics {
   25042 nanoseconds spent acquiring 1 JDBC connections;
   0 nanoseconds spent releasing 0 JDBC connections;
   1319016 nanoseconds spent preparing 11 JDBC statements;
   83631650 nanoseconds spent executing 11 JDBC statements;
   0 nanoseconds spent executing 0 JDBC batches;
   0 nanoseconds spent performing 0 L2C puts;
   83723194 nanoseconds spent performing 1766 L2C hits;
   13593721 nanoseconds spent performing 1764 L2C misses;
   12664271 nanoseconds spent executing 1 flushes (flushing a total of 5928 entities and 7755 collections);
  16903049699 nanoseconds spent executing 1767 partial-flushes (flushing a total of 10457112 entities and 10457112 collections)
  }
  </code></pre>
  
  <p>As you can see I loose a big amount of time when Hibernate is doing the "partial-flushes" stuff.</p>
  
  <p>Can someone please help me to understand what Hibernate exactly does when doing "partial-flushes", and howto reduce these flushes?</p>