ORMEntityOutOfSyncException

Posts   
 
    
S
User
Posts: 7
Joined: 13-Feb-2007
# Posted on: 13-Feb-2007 22:47:50   

I am getting this error - {"The entity is out of sync with its data in the database. Refetch this entity before using this in-memory instance."} System.Exception {SD.LLBLGen.Pro.ORMSupportClasses.ORMEntityOutOfSyncException} when I think my save does refetch entity object from database.

DataStandardEntity dse = new DataStandardEntity(); dse.ClinDataStdNm = r[0].ToString(); dse.ClinDataStdDesc = r[1].ToString(); dse.OdsLoadDate = DateTime.Now; dse.OdsUpdateDate = DateTime.Now; dse.SrcCreateDate = DateTime.Now; dse.SrcSysId = -1; dse.SrcDeleteInd = "N"; dse.SrcCreateDate = DateTime.Now; dse.SrcUpdateDate = DateTime.Now;

                _dataStandards.Add(dse);

                _adapter.SaveEntity(dse, true, true);

exception is thrown when I call "dse.ClinDataStdNm" after the above code snippet. Could you please tell me what I am doing wrong?

Thanks, S

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 13-Feb-2007 23:31:17   

I seem to recall getting that error when there was a data type or string length mismatch between the entity property and the value fir which it was assigned.

Please provide the info requested in the pinned post for posting guidelines.

S
User
Posts: 7
Joined: 13-Feb-2007
# Posted on: 13-Feb-2007 23:47:46   

"Please provide the info requested in the pinned post for posting guidelines"

I apologize, I am not familiar with the online posting guidelines - where would I find the pinned post?

And thanks for your response.

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 14-Feb-2007 08:33:33   

Disclaimer, I'm an end user just like you... Sorry for making assumptions, I usually post the link.

I didn't pay attention to what forum you posted in, this type of question is usually in the Generated Code forum. http://www.llblgen.com/TinyForum/Threads.aspx?ForumID=9

The pinned post is called "Guidelines for asking a question / reporting an issue"

http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725