I'm using Nettiers 2.2 and very happy with it. Lately we tracked down a problem that occurred when we did a MarkForDelete() on all children, followed by the parents and executed with DeepSave(). We run into a problem in that it generated an exception that turned out to be a foreign key contraint violation that only happened if the TList contained more than 300 entities. When searching through the code, I discovered the following in one of the templates (EntityProviderCoreClass.generated.cst):
/// Adds the specified entity property to the collection of properties.
/// </summary>
/// <param name="entity"></param>
/// <param name="key"></param>
public void AddRun( Object entity, string key )
{
if (entity != null && !string.IsNullOrEmpty(key))
{
string lkey;
if (entity is IEntity)
lkey = ((IEntity)entity).EntityTrackingKey + key;
else
lkey = entity.GetHashCode().ToString()+ key;
DeepSessionInnerList.Add(lkey, entity);
}
if (DeepSessionInnerList.Count > 300)
CancelSession = true;
}
Can anyone shed any light as to why the number 300 is hard coded into the template and preventing a DeepSave() of more than 300 child entities? Intentional or a bug?