title: Hibernate: Do I ever need to flush()?
body: <p>I have a bidirectional one-to-many relationship. I'm trying to persist it like in this doc:</p>
  
  <p><a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/example-parentchild.html#example-parentchild-bidir">http://docs.jboss.org/hibernate/core/3.3/reference/en/html/example-parentchild.html#example-parentchild-bidir</a></p>
  
  <pre><code>Parent p = (Parent) session.load(Parent.class, pid);
  Child c = new Child();
  c.setParent(p);
  p.getChildren().add(c);
  session.save(c);
  session.flush();
  </code></pre>
  
  <p>Is the <code>flush()</code> required there? What exactly does it do? I know what it does, but I discovered it costs me 100 ms and I would really like to avoid it if possible.</p>
  
  <p>When <code>session.load()</code> or even <code>session.refresh()</code> is called and I hadn't flushed, will it include the new <code>Child</code> in the collection?</p>