Cannot persist

Gentle.NET Forum

Cannot persist

Postby yxw11 on Thu Jun 29, 2006 9:51 pm

Hi,

I am using v965 to generate my bussiness classe. And manually modify the code to added the concurrency control.
Code: Select all
[TableColumn(\"RowVersion\", NullValue=1), Concurrency]
And I am getting following error message.

The number of returned rows 0 did not match the expected count of 1+.
If concurrency control is enabled this may indicate that the record was updated or deleted by another process.

The error is pointint to the generated class, line 124.
Code: Select all
Line 122:         if (IsChanged || !IsPersisted)
Line 123:         {
Line 124:            base.Persist();
Line 125:            isChanged = false;
Line 126:         }


The C# code in code behind is very simple:
Code: Select all
MyObject _theObject = MyObject.Retrieve(myKey);
_theObject.OneField = \"some new value\";
_theObject.Persist();


Anyone knows why this happened? The record in the database is not updated nor deleted. The OneField is not a primary key. How to fix this? Thanks a million!
yxw11
Lurker
 
Posts: 5
Joined: Wed Apr 19, 2006 4:44 pm

Postby angelo on Sat Aug 26, 2006 5:15 pm

Hi there, have you tried asking this on the Gentle.Net forum on Sourceforge? Looks like a framework problem rather than a codegen problem to me.
Vision without action is a daydream, action without vision is a nightmare...
User avatar
angelo
Major General
 
Posts: 159
Joined: Mon Jul 12, 2004 8:17 pm
Location: Best, The Netherlands


Return to Gentle.NET

Who is online

Users browsing this forum: No registered users and 1 guest

cron