For those who are interested, I'm now using this hack to NHibernate to prevent the problem:
In src\NHibernate\AdoNet\Expectations.cs, class BasicExpectation, method VerifyOutcomeNonBatched(), change
Code:
if (expectedRowCount > rowCount)
{
throw new StaleStateException(...);
}
to
Code:
if (expectedRowCount > rowCount)
{
if (statement.CommandText.ToUpperInvariant().StartsWith("DELETE "))
{
// Just ignore; who cares if the row to be deleted is already gone?
}
else
{
throw new StaleStateException(...);
}
}
Unless someone can give a good reason why this is a bad idea, please consider this change for the trunk ...