title: Evicting and Updating object using NHibernate nulls all references
body: <p>I am investigating some unexpected behavior with NHibernate that needs more clarity.
  I create a new object 'Request' and save it. I create another object 'AuditLog' and add request as a reference to AuditLog. I save that too.
  Now, if the Request object is evicted from the session (for some reason), and updated again, the references in AuditLog is NULLified in the database when the transaction is committed.</p>
  
  <p>Any ideas on why this would happen?</p>
  
  <p>If the Request object is not created in the session, but retrieved from the database, and the same process runs, the reference in AuditLog is maintained.</p>
  
  <p>Sample code which has been edited for ease in understanding.
  If I remove the <code>session.Evict(request1)</code> from the code, the test passes. With this code, when the session closes, an additional query is fired on the DB to null the reference of request in AuditLog.</p>
  
  <pre><code>//Session 1
  var session = Resolve&lt;IFullSession&gt;().Session();
  using (var tx = session.BeginTransaction())
  {
      var request1 = new Request { Id = "REQ01" };
      request1.SetFieldValue("Type", "Stage1"); //Type is column in Request table
      session.Save("Request", request1);
  
      var auditLog1 = new AuditLog { Id = "LOG01" };
      auditLog1.SetFieldValue("Request", request1); //Request is reference column to AuditLog
      session.Save("AuditLog", auditLog1);
  
      session.Evict(request1);
      request1.SetFieldValue("Type", "Stage2");
      session.SaveOrUpdate("Request", request1);
  
      tx.Commit();
  }
  CreateInnerContainers(); // This closes earlier session.
  //Session 2
  var session2 = Resolve&lt;IFullSession&gt;().Session();
  using (var tx = session2.BeginTransaction())
  {
      var theLogObject = session2.Get&lt;AuditLog&gt;("LOG01");
      Assert.IsNotNull(theLogObject); // This is true
      Assert.IsNotNull(theLogObject.GetFieldValue("Request")); // This fails
      tx.Commit();
  }
  </code></pre>