exception

May 18, 2012 at 7:21 PM
Edited May 19, 2012 at 12:21 AM

hi, 

 

at my first try with some real data, in a asp4.net web site; and I get an exception on workspace commit.

on Mono Runtime Version: <tt>2.10.8.1 (Debian 2.10.8.1-1ubuntu2)</tt>; ASP.NET Version: <tt>4.0.30319.1</tt>

System.ArgumentNullException: Argument cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[System.Type,System.Guid].Add (System.Type key, Guid value) [0x00000] in <filename unknown>:0 
  at Execom.IOG.Services.Data.TypesService.InitializeTypeSystem (System.Type[] types) [0x00000] in <filename unknown>:0 
  at Execom.IOG.Context.InitializeServices (System.Type rootEntityType, System.Type[] entityTypes, Execom.IOG.Upgrade.UpgradeConfiguration upgradeConfiguration) [0x00000] in <filename unknown>:0 
  at Execom.IOG.Context..ctor (System.Type rootEntityType, System.Type[] entityTypes, IKeyValueStorage`2 storage) [0x00000] in <filename unknown>:0 

I traced the error using debug version of IOG, 

and the exception happens in: Execom.IOG/Graph/BPlusTreeOperations.cs

private bool MoveNextInternal()           

                var current = Current;   << exception on getiing Current value

throw a "System.InvalidOperationException: Operation is not valid due to the current state of the object"

I made a quick/bad patch 

Edge<Guid, EdgeData> current = null;

  try { current = Current; } catch { }

 

 

 

Coordinator
Jun 7, 2012 at 3:45 PM

This would typically occur when during an enumeration through list there are also modifications done on the list itself (like adding/removing elements).

Same rules apply as with .NET collections: If you need to change the list during the enumeration (foreach), collect the changes to a temp list and perform removals/additions after the loop.

Coordinator
Jun 12, 2012 at 1:14 PM
nenadsabo wrote:

This would typically occur when during an enumeration through list there are also modifications done on the list itself (like adding/removing elements).

Same rules apply as with .NET collections: If you need to change the list during the enumeration (foreach), collect the changes to a temp list and perform removals/additions after the loop.

The conclusion above was not correct, there was an error in the debug logging, which is now fixed.

The original problem you described seems to be because "null" is contained in list of types passed to constructor of Context. Please check that list does not contain "null" references. Be aware of "as" operator, because it may yield "null" if type conversion is not possible.