The hack for me that seems to work is not mapping the rowversion
column for bulk insert/update operations. They happen overnight in a
different process. And leave it mapped for UI where it's mostly needed
because more than on user access the the app via UI. Also imports must
have the final say, and users should not override imported data with
stale data from the UI.

I am not sure about using int, how that works if you write from
different processes (using NH) to same db?


On Apr 24, 10:05 am, Alex Vilela <[email protected]> wrote:
> Have you tried a version column with the default type, an integer?
>
> NHibernate needs to know the version value to update it's caches.
> On a DB controlled timestamp column the extra select is required.
> With an integer column, NH calculates the field before the update and no
> further select is required.
>
>
>
> On Thursday, 19 April 2012 17:48:33 UTC+1, Greg wrote:
>
> > I use Versioning with SQL Server with a rowversion(timestamp) column.
> > In Entity Framework one can disable the select after insert/update
> > with a simple flag.
> > But I couldn't figure out how to do it in NH. This fact disables
> > batching completely and slows down things considerably.
>
> > I don't care what's the updated rowversion value after the insert/
> > update.
> > Any idea how to disable the select after insert/update with a db
> > generated rowversion column?
>
> > This is my current mapping:
> > <version name="RowStamp" type="Byte[]" insert="false"
> > generated="always" unsaved-value="undefined"> <column name="RowStamp"
> > not-null="true" sql-type="rowversion" length="8"/> </version>
>
> > If I remove generated, I get some null pointer exception somewhere
> > deep inside NH.
>
> > What kind of mapping could I use to disable the select after insert/
> > update, or is there some other config option inside NH for that.

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