Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# swilliam 3/8/2007 5:10 PM
Dear All

I've noticed a lot of Cuyahoga's database tables contain two columns, inserttimestamp and updatetimestamp, both set initially to the current date and time. NHibernate seems to recommend the use of timestamp values for optimistic locking. Should I use them in all of my tables, or just frequently updated ones?

Many thanks

Simon
# martijnb 3/9/2007 5:12 AM
It's a matter of personal preferences. I just like to have these in the database tables, so it's always possible to see when a record was inserted or updated. In client-server scenarios I also add the insertuser and updateuser columns to see who did it.

The timestamps already where in the database before we used NHibernate and since they were there already, why not use them for optimistic concurrency. When starting from scratch, I'd use version numbers for optimistic concurrency though because there can be some little issues with timestamps sometimes.
# swilliam 3/9/2007 5:49 AM
Martijn

Thanks. I might change our timestamps to version numbers.

Cheers

Simon