New Posts New Posts RSS Feed: Exception in GetEnumerator
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Exception in GetEnumerator

 Post Reply Post Reply
Author
jsobell View Drop Down
Groupie
Groupie
Avatar

Joined: 02-Apr-2009
Location: Australia
Posts: 80
Post Options Post Options   Quote jsobell Quote  Post ReplyReply Direct Link To This Post Topic: Exception in GetEnumerator
    Posted: 27-Feb-2011 at 6:45pm
An IdeaBlade exception is thrown in (non-SilverLight) code when compound primary key contains NULL.
We have a simple view on our database with an outer join, and in flagging the fields we thought was a unique key, it turns out that one element could be NULL due to the OUTER clause.  This raises an internal exception when the enumerator is fetched.
While this is a situation to avoid, it's extremely difficult to identify the cause of the exception, sp perhaps it needs either a check internally so meaningful feedback can be displayed?

Cheers,
 Jason

                    var datarows = from datarow in _context.ExportAllResponseDatas
                                   where datarow.QuestionnaireVersionId == qversionid
                                         && datarow.LastUpdated <= _snapshotTime
                                         && (datarow.ResponseState.HasValue && datarow.ResponseState.Value != 1)
                                   orderby datarow.ResponseSetID
                                   select datarow;

                    var dataenumerator = datarows.GetEnumerator();

Exception trace is show below.

IdeaBlade.EntityModel.EntityServerException: {"Object reference not set to an instance of an object."}

StackTrace:
   at IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception ex, Boolean tryToHandle, PersistenceOperation operation, Boolean throwOnError)
   at IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)
   at IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)
   at IdeaBlade.EntityModel.EntityQueryFinder.Execute()
   at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
   at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()
   at QuestMetrics.QuestServer.DataExportService.DataExporterBase.ExportData(Func`2 progresscallback) in C:\Source\Stuff\DataExporterBase.cs:line 320

InnerException:
   at IdeaBlade.EntityModel.EntityServerProxy.CheckConnection(Exception e)
   at IdeaBlade.EntityModel.EntityServerProxy.Fetch(SessionBundle bundle, IEntityQuerySurrogate query)
   at IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)



Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 28-Feb-2011 at 10:58am
Hi jsobell;

Thanks for the feedback. Let me try to repro this and file a bug report as needed.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down