title: nhibernate - cyclic reference not updating
body: <p>I have two objects that reference each other. From a purely schema perspective, object one could have many instances of object two that reference it, but the business logic specifies that each instance of object 2 will reference a unique instance of object one and vice versa.</p>
  
  <p>Example:</p>
  
  <pre><code>public class Object1 {
      public Guid Id {get;set;}
      public Object2 Object2 {get;set;}
  
      public Object1ClassMap : ClassMap&lt;Object1&gt; 
      {
          // ...
          References&lt;Object2&gt;(x=&gt;x.Object2)
              .Column("Object2Id")
              .Cascade.SaveUpdate()
              .Not.LazyLoad();
      }
  }
  
  public class Object2 {
      public Guid Id {get;set;}
      public Object1 Object2 {get;set;}
  
      public Object2ClassMap : ClassMap&lt;Object1&gt; 
      {
          // ...
          References&lt;Object1&gt;(x=&gt;x.Object1)
              .Column("Object1Id")
              .Cascade.SaveUpdate()
              .Not.LazyLoad();
      }
  }
  </code></pre>
  
  <p>When I do the following:</p>
  
  <pre><code>instanceOfObject1.Object2 = instanceOfObject2
  </code></pre>
  
  <p>I would expect NHibernate to detect the back reference and automatically do</p>
  
  <pre><code>instanceOfObject2.Object1 = instanceOfObject1
  </code></pre>
  
  <p>for me, but this doesn't happen. I have to manually update in both directions. Any way to avoid this?</p>