Page 1 of 1

Using Numberic Value instead of TimeStamp

Posted: Wed 22 Sep 2010 18:43
by AKhan
I am updating my entity by attaching it to the Context. I am trying to use IsVersion attribute on a Numeric column to be used for the concurrency control. But the column value doesn’t get incremented by itself and neither does it allow updating or inserting the value for that column.
Do we have to use TimeStamp for concurrency control. Can we just create a Numeric column and set it IsVersion = true. Will this auto increment the value on Update?


[Column(Name = @"_MyVERSIONRow", Storage = "_MyVersionRow", CanBeNull = false, DbType = "NUMBER(5) NOT NULL")]
public int myVersionRow
{
get
{
return this._MyRowVersion;
}
set
{
if (this._MyRowVersion != value)
{
this._MyRowVersion = value;
}
}
}

Posted: Thu 23 Sep 2010 08:11
by StanislavK
The IsVersion property is used to check that the row was updated, but it is not incremented automatically by LinqConnect. This incrementation should be performed at the database side, so you probably need to implement a special trigger that will change the version field on row updates.

Feel free to contact us if anything is unclear.