I tried implementing the timestamp.
Can it really be true that you have to define the datatype like this?
<version name ="Rowver" column ="rowver" type="System.Byte[],
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" generated ="always"/>
it's the overly long byte array definition i am referring to.

Now I just have to implement timestamping for about 100 more tables.
weee :D booo for not being paid by the hour.

On Jun 4, 3:41 pm, Michael Abraham <[email protected]> wrote:
> You are correct that only NH will update a Version column.  That is why I
> suggested using a timestamp column (which you can do since you are using
> SQL Server).  With a timestamp, any update will will generatre a new value
> for the timestamp column.  BTW, don't fall into the trap of thinking that
> timestamp columns as having anything to do with the date/time - better to
> think of them as unique (per table) 64-bit values.
>
> Mike
>
>
>
>
>
>
>
> On Friday, June 1, 2012 8:05:49 AM UTC-4, imonsei wrote:
> > I have defined a class, and set
>
> > dynamic-update="true" optimistic-lock="all" select-before-
> > update="true"
>
> > in my tabledefiniton hbm.xml file.
> > I start my program and load my data in displaying it in a
> > datagridview.
> > Next I load up sql management studio (mssql2008 express), connect to
> > the database, and alter an entry in the table i have just loaded into
> > the program.
> > Meanwhile in the program I make sure the change has not propergated
> > into the datagridview.
> > Now I change something in the row I had altered with sql management
> > studio.
> > I save my change from the datagridview to the database.
>
> > What I expected was an exception being thrown by the program, but
> > instead I find that the change I made with sql management studio has
> > been overwritten completely with the other data from my program.
>
> > Can anyone take a stab at where I go wrong?
> > PS. just say and I'll post the code I use, if you need it.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to