title: NHibernate many-to-many, unable to delete a row
body: <p>I've got following entities: Project, ProjectMapping and User, it's many to manyHere are the mappings:</p>
  
  <pre><code>public ProjectMembershipMapping()
  {
      Property(pm =&gt; pm.IsAccepted, prop =&gt; prop.NotNullable(true));
      Property(pm =&gt; pm.Permission, prop =&gt; prop.NotNullable(true));
      ManyToOne(pm =&gt; pm.Member, mapping =&gt;
                                     {
                                         mapping.Lazy(LazyRelation.NoLazy);
                                         mapping.Cascade(Cascade.All);
                                     });
      ManyToOne(pm =&gt; pm.Project, mapping =&gt;
                                      {
                                          mapping.Lazy(LazyRelation.NoLazy);
                                          mapping.Cascade(Cascade.All);
                                      }); 
  
      ComposedId(pm =&gt;                                          
                     {
                         pm.ManyToOne(prop =&gt; prop.Member);
                         pm.ManyToOne(prop =&gt; prop.Project);
                     });
  }
  
  public ProjectMapping()
  {   
      Set(proj =&gt; proj.Members,
              mapping =&gt;
              {
                  mapping.Lazy(CollectionLazy.NoLazy);
                  mapping.Inverse(false);
                  mapping.Cascade(Cascade.All);
                  mapping.Table("ProjectMembership");
                  mapping.Key(k =&gt; k.Column("Project"));
              },
              action =&gt; action.OneToMany()
          );      
  }
  
  public class DevcoopUserMapping : ClassMapping&lt;DevcoopUser&gt;
  {
          Bag(user =&gt; user.ProjectMemberships, 
              mapping =&gt;
                  {
                      mapping.Lazy(CollectionLazy.NoLazy);
                      mapping.Inverse(false);
                      mapping.Cascade(Cascade.All);
                      mapping.Table("ProjectMembership");
                      mapping.Key(k =&gt; k.Column("Member"));
                  },
              action =&gt; action.OneToMany());
  }
  </code></pre>
  
  <p>User can be a member of many projects. Now let's say I'm gonna unsubscribe him from project. Just deleting ProjectMembership object by ISession  object throws me:</p>
  
  <pre><code>deleted object would be re-saved by cascade (remove deleted object from associations)[devcoop.Daos.ProjectMembership#devcoop.Daos.ProjectMembership]
  </code></pre>
  
  <p>On the other hand, when I first try to delete this ProjectMembership instance from Project and User (I delete it from the associations as was suggested to me), I get exception:</p>
  
  <pre><code>could not delete collection: [devcoop.Daos.Project.Members#1][SQL: UPDATE ProjectMembership SET Project = null WHERE Project = @p0]
  </code></pre>
  
  <p>Can anyone help? Supposedly I screwed up something around the mappings, but I got no idea what can this be.</p>