Skip to content

Commit 066cd0a

Browse files
committed
CollectionPersisterExtensions.GetBatchSize returns 1 as a safe batch size if ICollectionPersister is not supported.
1 parent ff01ff7 commit 066cd0a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NHibernate/Persister/Collection/ICollectionPersister.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,11 @@ public static int GetBatchSize(this ICollectionPersister persister)
298298
return acp.GetBatchSize();
299299
}
300300

301-
throw new InvalidOperationException("Only persisters of AbstractCollectionPersister are supported.");
301+
NHibernateLogger
302+
.For(typeof(CollectionPersisterExtensions))
303+
.Warn("Collection persister of {0} type is not supported, returning 1 as a batch size.", persister?.GetType());
304+
305+
return 1;
302306
}
303307
}
304308
}

0 commit comments

Comments
 (0)