You don't state your NHibernate version, but in 3.3.2 the only call to
IInterceptor.SetSession(...) I can find is:
private SessionImpl OpenSession(IDbConnection connection, bool
autoClose, long timestamp, IInterceptor sessionLocalInterceptor)
{
SessionImpl session = new SessionImpl(...);
if (sessionLocalInterceptor != null)
{
// NH specific feature
sessionLocalInterceptor.SetSession(session);
}
return session;
}
And clearly, session can never be null there.
/Oskar
2012/12/4 Clonus <[email protected]>:
> Hi, I've been experiencing a problem with NHibernate.EmptyInterceptor.>
> SetSession(ISession session) method.
>
> Very intermittently I experience the session object as null, therefore, no
> SQL DB connectivity. I don't believe this is a coding issue as the problem
> replicates itself at the same time across multiple servers.
>
> What I would like to know is under what conditions does session become null
> in this case?
>
> If the problem is due to lose of connectivity between the web servers and
> the SQL DB (which causes session to become null) what steps should be done
> to rectify the session object? Assuming that this is a quick recovering
> connectivity issue.
>
> Suggestions? anything, I appreciate anything anyone may have, thanks!
> Clo