Spring.Data.NHibernate.SessionFactoryUtils.ReleaseSession C# (CSharp) Method

ReleaseSession() public static method

Close the given Session, created via the given factory, if it is not managed externally (i.e. not bound to the thread).
public static ReleaseSession ( ISession session, ISessionFactory sessionFactory ) : void
session ISession The hibernate session to close
sessionFactory ISessionFactory The hibernate SessionFactory that /// the session was created with.
return void
	    public static void ReleaseSession(ISession session, ISessionFactory sessionFactory)
	    {
            if (session == null) 
            {
                return;
            }
            // Only close non-transactional Sessions.
            if (!IsSessionTransactional(session, sessionFactory)) 
            {
                CloseSessionOrRegisterDeferredClose(session, sessionFactory);
            }
	    }