title: Found shared references to a collection
body: <p>I have a product object that contains 2 collections, accessories and consumers. Consumers relates to an accessory, the list of products that consume it. In the database I have a many to many relationship for these collections that is implemented as a linking table Product_Accessory. In mapping I have created a many to many one way for the accessories and the other way for consumers :</p>
  
  <pre><code>        mapping.HasManyToMany&lt;oProduct&gt;(x =&gt; x.Accessories)
              .Table("Product_Accessory")
              .Cascade.SaveUpdate()
              .ParentKeyColumn("ProductId")
              .ChildKeyColumn("AccessoryId")
              .AsBag();
  
          mapping.HasManyToMany&lt;oProduct&gt;(x =&gt; x.Consumers)
              .Table("Product_Accessory")
              .Cascade.SaveUpdate()
              .ParentKeyColumn("AccessoryId")
              .ChildKeyColumn("ProductId")
              .AsBag();
  </code></pre>
  
  <p>This all seems very logical but nHibernate is giving me an error of Found shared references to a collection because there are two lists of products.</p>
  
  <p>Is this pattern possible using nHibernate? What is the best way to achieve this?</p>
  
  <p>Thanks</p>
  
  <p>Phil</p>