/// <inheritdoc />
        public ISession GetSession(IDatabase database)
        {
            Fail.IfArgumentNull(database, nameof(database));

            SessionsContainer container = this.GetSessionsContainer();
            ISession          session   = container.GetSession(database);

            return(session);
        }
        /// <inheritdoc />
        public ISession GetSession(IDatabase database)
        {
            Fail.IfArgumentNull(database, nameof(database));

            SessionsContainer container = this.GetSessionsContainer();
            ISession          session   = container.GetSession(database);

            if (session != null && session.IsOpen == false)
            {
                // Session is closed so lets remove it and return null
                container.RemoveSession(session);
                session = null;
            }
            return(session);
        }