I currently have this Fluent NHibernate configuration:
public class NHibernateConfig
{
public static Configuration Configure()
{
var cfg = Fluently.Configure()
.Database(Config.PersistenceConfiguration)
.Mappings(m =>
{
m.FluentMappings.AddFromAssemblyOf<SomeAssembly>();
m.FluentMappings.Conventions.AddFromAssemblyOf<EnumConvention>(); })
.ExposeConfiguration(x => x.SetProperty("current_session_context_class", "thread_static"))
.BuildConfiguration();
return cfg;
}
}
My question is about the exposed property "current_session_context_class." I know of two values for this: thread_static or web. A colleague of mine pointed out another value, which is call. Are there any known documentation for values of this property? If not, are there any good descriptions for these values? I've scoured Google for hours for some explanations with no valid result.
Here is my attempt to explain these (Any additional input would be welcome):
Difference between CallSessionContext, ThreadLocalSessionContext and ThreadStaticSessionContext
There is a section on these in the standard NH documentation but I don't think they do a very good job explaining it or giving any examples on how exactly to use it. Here is the NH documentation link.
http://nhibernate.info/doc/nhibernate-reference/architecture.html#architecture-current-session
There are several decent articles on StackOverflow about how you would use this:
What is the best NHibernate session management approach for using in a multithread windows service application?
NHibernate.HibernateException: No session bound to the current context