I’m running a wpf app. With a nhibernate session you only have to query a table once and you can access it as many times as you like from cache.
But i like to cache some tables through the entire app because they almost never change, like users and usergroups. Should i use one session for the entire app or is there another solution?
The cache that NHibernate provides as part of the session is referred to as the first level cache.
For caching things longer than the duration of a session, you need to take a look at the second level cache. NHibernate ships with implementations for several cache providers (memcached, SysCache, etc.).