title: getting {"could not execute batch command.[SQL: SQL not available]"} error from NHibernate
body: <p>I took a look at other related posts but couldn't find any solution.<br>
  Sometimes on sesstion.Flush() I get the following error:</p>
  
  <p><strong>{"could not execute batch command.[SQL: SQL not available]"}</strong></p>
  
  <p>and the Inner Exception : </p>
  
  <p><strong>{"The UPDATE statement conflicted with the FOREIGN KEY constraint FK1377052553ABF955. The conflict occurred in database ProcessDebug, table dbo.Adjustment, column 'AdjustmentId'.The statement has been terminated."}</strong></p>
  
  <p>a piece of Process class mapping :</p>
  
  <pre><code>   References(p =&gt; p.CurrentAdjustment)
          ;
  
      References(p =&gt; p.DefaultAdjustment)
          ;
  
      HasMany(p =&gt; p.Adjustments)
          .Cascade.AllDeleteOrphan()
          .Inverse()
          ;
  </code></pre>
  
  <p>All these properties above are of type of Adjustment.
  As long as I get this error once in a while I couldn't track it down. For an entity it might happen now, but not next time in a same piece of code.... </p>
  
  <p>Any idea what might cause the problem?<br>
  I'm using NH 3.2  and FluentNhibernate<br>
  Thanks in advance</p>