This is a migrated thread and some comments may be shown as answers.

Exception "Access to unfilled state field..."

5 Answers 153 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jay
Top achievements
Rank 1
Jay asked on 06 Jul 2011, 07:49 PM
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.

5 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 07 Jul 2011, 10:32 AM
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!

0
Jay
Top achievements
Rank 1
answered on 08 Jul 2011, 03:31 PM
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
0
Jan Blessenohl
Telerik team
answered on 11 Jul 2011, 11:31 AM
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!

0
Jay
Top achievements
Rank 1
answered on 20 Jul 2011, 03:38 PM
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
0
Ross Presser
Top achievements
Rank 1
answered on 12 Dec 2011, 05:08 PM
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?
Tags
Development (API, general questions)
Asked by
Jay
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Jay
Top achievements
Rank 1
Ross Presser
Top achievements
Rank 1
Share this question
or