private static bool SafeIsDirty(ISession sess)
{
var isDirty = false;
try
{
isDirty = sess.IsDirty();
}
catch (AssertionFailure)
{
isDirty = false; //cannot flush, since something is wrong with the objects (an exception occured already during this DataContext)
}
return isDirty;
}