Using Numberic Value instead of TimeStamp

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
AKhan
Posts: 4
Joined: Wed 22 Sep 2010 17:17

Using Numberic Value instead of TimeStamp

Post by AKhan » Wed 22 Sep 2010 18:43

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;
}
}
}

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 23 Sep 2010 08:11

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.

Post Reply