How do you deal with concurrency in NHibernate?

nhibernate

Solution

NHibernate, by default, supports optimistic concurrency. Pessimistic concurrency, on the other hand, can be accomplished through the `ISession.Lock()` method.

These issues are discussed in detail in this document.

Problem

How do you support optimistic / pessimistic concurrency using NHibernate?

Original source