Exception "Access to unfilled state field..."

6 posts, 0 answers
  1. Jay
    Jay avatar
    8 posts
    Member since:
    Jun 2011

    Posted 06 Jul 2011 Link to this post

    I am getting an exception:
    Access to unfilled state field ORM_Model.Source:SourceType1 stateField=7
    when trying to add an element to the database via a context.Add(element) call.

    Partial Stack Trace for exception:
       at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.makePersistent(Object o)
       at OpenAccessRuntime.DataObjects.SynchronizedPMProxy.makePersistent(Object o)
       at Telerik.OpenAccess.RT.ObjectScope.Add(Object pc)

    I've attempted to use the debugger to locate what element data is missing or incorrect (all non-null-able field has valid data) at the time context.Add is being called. It is inserting identically formatted elements with no problem. Unfortunately, I have been unable to recreate this exception on a smaller scale to post here.

    I have no idea what the issue might be and any assistance would be greatly appreciated.
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 07 Jul 2011 Link to this post

    Hi Jay,
    We have a check that makes sure that you are only updating data that is already loaded. Because your code is an Add(), I am not sure what really goes on, maybe you have a reference to an already persistent object inside your new object.
    It would help me to did further into the problem if you can send me the complete stack trace with all inner exceptions. You can create that by just calling exception.ToString() in your application or in the details window in the debugger.

    Greetings,
    Jan Blessenohl
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Jay
    Jay avatar
    8 posts
    Member since:
    Jun 2011

    Posted 08 Jul 2011 Link to this post

    Hi Jan,

    Here is the full stack trace:

    Access to unfilled state field ORM_Model.Source:SourceType1 stateField=7
    Source: Telerik.OpenAccess
    StackTrace:
       at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.makePersistent(Object o)
       at OpenAccessRuntime.DataObjects.SynchronizedPMProxy.makePersistent(Object o)
       at Telerik.OpenAccess.RT.ObjectScope.Add(Object pc)
       at ORM_Model.Source.FindAdd(Model context, Source source, Country country) in C:\Project\Extensions\Source.cs:line 349

    There were no inner exceptions, I realize this isn't much more information than above, but I appreciate the help.

    Jay
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 11 Jul 2011 Link to this post

    Hello Jay,
    puh, i have also no idea how I can dig into it without more help from you. Is it possible to get your application? I do not need the sources, the running app so that I can debug the OpenAccess layer would be fine.

    Regards,
    Jan Blessenohl
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Jay
    Jay avatar
    8 posts
    Member since:
    Jun 2011

    Posted 20 Jul 2011 Link to this post

    Hi Jan,

    I'm not sure what the problem was, but I had recreated the ORM Model and this fixed the problem. Maybe some minor configuration error...

    Thanks anyways,

    Jay
  7. Ross Presser
    Ross Presser avatar
    30 posts
    Member since:
    Dec 2008

    Posted 12 Dec 2011 Link to this post

    Jay,

    I'm trying to isolate a similar problem (that happens in a few dozen places). When you say you "recreated the ORM Model" do you mean you started from scratch? Or just that you rebuilt the project?  Were you using forward or reverse mapping?
Back to Top
DevCraft banner