title: Hibernate refresh session with deleted object in DB
body: <p>I have an object <strong>Sample</strong> that contains a <em>Collection</em> of <strong>Foo</strong> objects.</p>
  
  <pre><code>public class Sample {
  
    private String name;
    private List&lt;Foo&gt; fooList;
  
    public String getName() {
      return name;
    }
  
    public void setName(String n) {
      name = n;
    }
  
    public List&lt;Foo&gt; getFooList() {
      return fooList;
    }
  
    public void setFooList(List&lt;Foo&gt; list) {
      fooList = list;
    }
  
  }
  </code></pre>
  
  <p>The objects Sample and Foo are correctly mapped in Hibernate.</p>
  
  <p>I open ah Hibernate transaction and I have in a cache an instance of Sample with "name" = "tommaso".
  Someone modifiy in the DB that row and change name in "massimo".
  If I want to refresh the instance in cache, I write</p>
  
  <pre><code>Sample sample = ...;
  session.refresh(sample);
  </code></pre>
  
  <p>Hibernate refresh the instance of Sample object and the attribute <em>name</em> became "massimo". It works!</p>
  
  <p>If someone edit the collection of this instance, and delete one <em>Foo</em> in the <em>fooList</em>, when I do refresh of that instance <em>Sample</em>, Hibernate throws <strong>no row with the given identifier exists</strong>.</p>
  
  <p>How can I refresh the session cache with real situation in the db?</p>