Stateless NHibernate for queries

We have a database that is updated through a background process. We use NHibernate to query the data for display in the frontend, so we don't need change tracking or lazy loading.

If we mark all mappings mutable = "false" is it the same as using a stateless session?

+2


a source to share


1 answer


No, it is not the same. In fact, it has absolutely nothing to do with it (i.e. you can modify objects in stateless sessions).

A StatelessSession does not track entities, resulting in big performance improvements (both in memory usage and runtime) when you don't need the functionality that a stateless session provides.



In particular:

  • No lazy loading
  • No caching
  • No cascading
  • All updates must be explicit (insert / update / delete)
+4


a source







All Articles