Closes the session.
346056
public boolean close() {
    if (open.compareAndSet(true, false)) {
      futures.forEach(future -> future.completeExceptionally(new IllegalStateException("Closed session")));
      return true;
    }
    return false;
  }
687948
public void close(boolean arbitrarily) {
        if (checkSession()) {
            return;
        }

        arbitrarilyClosed = arbitrarily;
        sqlSession.close();

        if (log.isDebugEnabled()) {
            log.debug(String.format("Closed %s@%x",
                    sqlSession.getClass().getSimpleName(),
                    sqlSession.hashCode()));
        }

        sqlSession = null;
    }
997528
public void disconnect() {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Disconnecting client for session: 0x"
                    + Long.toHexString(getSessionId()));
        }

        sendThread.close();
        eventThread.queueEventOfDeath();
    }
620900
public void destroy() {
        DeferredBindingActions.clear();
        if(!disconnected.isEmpty()) {
            disconnected.pop();
        }
        if (getSessionFactory() == null || decNestingCount() > 0 || getParticipate()) {
            return;
        }

        // single session mode
        SessionHolder holder = (SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
        LOG.debug("Closing single Hibernate session in GrailsDispatcherServlet");
        try {
            disconnected.clear();
            SessionFactoryUtils.closeSession(holder.getSession());
        }
        catch (RuntimeException ex) {
            LOG.error("Unexpected exception on closing Hibernate Session", ex);
        }
    }
1127360
public void close() {
        synchronized (sessions) {
            closed = true;
            sessionCleaner.close();
            sessions.stream().forEach(PooledSession::reallyClose);
        }
    }
1233300
@Override
  public void closeSession(SessionHandle sessionHandle) throws HiveSQLException {
    try {
      TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle());
      TCloseSessionResp resp = cliService.CloseSession(req);
      checkStatus(resp.getStatus());
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
471912
public function close(){
        if($this->status() !== self::ACTIVE){
            throw Exception\SessionException::notStarted();
        }

        session_commit();
        
        $this->finishedData = $_SESSION;
    }
1010101
protected void safeClose () {
        Session closeSession = this.socketSession;
        this.socketSession = null;

        try {
            if (closeSession != null) {
                //
                // Remove from the registry first in case the close blocks for a while.  Doing so prevents additional
                // errors logged for attempts to send to this now-defunct websocket.
                //
                registry.remove(this.socketSessionId);
                closeSession.close();
            }
        } catch (IOException ioExc) {
            log.debug("io exception on safe close of session", ioExc);
        }
    }
350291
def close(self):
        
        if self._session is not None:
            try:
                self._session.close()
                self._session = None
            except socket.error as e:
                if e.errno != errno.ECONNRESET:
                    raise
1306305
public function closeSession()
    {
        if (isset(\Yii::$app) && \Yii::$app->has('session', true)) {
            \Yii::$app->session->close();
        }
    }
169440
def close_session(self):
        """"""
        if not self._session.closed:
            if self._session._connector_owner:
                self._session._connector.close()
            self._session._connector = None
896164
def close(self):
        """"""
        logger('HttpConnection').debug('Closing connection....')
        self.writer.close()
        self._closed = True
1038461
public function close()
    {
        $this->getMinkSession()->getDriver()->getBrowser()->close();
        $this->getMinkSession()->getDriver()->switchToWindow(null);
    }
1326514
def close(self):
        

        self.__decrement_connection_counter()
        if self.connection_count == 0:
            if self.dbfile == ":memory:":
                SQL = """DROP TABLE IF EXISTS __self__"""
                self.sql(SQL, asrecarray=False, cache=False)
            else:
                self.connection.commit()
                self.connection.close()
927741
public void closeSession(long index, long timestamp, RaftSession session, boolean expired) {
    log.debug("Closing session {}", session.sessionId());

    // Update the session's timestamp to prevent it from being expired.
    session.setLastUpdated(timestamp);

    // Update the state machine index/timestamp.
    tick(index, timestamp);

    // Expire sessions that have timed out.
    expireSessions(currentTimestamp);

    // Remove the session from the sessions list.
    if (expired) {
      session = sessions.removeSession(session.sessionId());
      if (session != null) {
        session.expire();
        service.expire(session.sessionId());
      }
    } else {
      session = sessions.removeSession(session.sessionId());
      if (session != null) {
        session.close();
        service.close(session.sessionId());
      }
    }

    // Commit the index, causing events to be sent to clients if necessary.
    commit();
  }
1334269
public static void closeSession(String wrapper) {
		Session session = map.get(wrapper);
		if (session != null) {
			Method method;
			try {
				method = session.getClass().getDeclaredMethod("protectedClose");
				method.setAccessible(true);
				method.invoke(session);
			} catch (InvocationTargetException e) {
				throw new RiverException(e.getCause().getMessage(), e);
			} catch (Exception e) {
				throw new RiverException(e);
			}
			map.remove(wrapper);
		}
	}
467612
@Override
	public final void close() throws JMSException
    {
    	externalAccessLock.writeLock().lock();
    	try
		{
	        if (closed)
	            return;
	        closed = true;
	        onSessionClose();
		}
    	finally
    	{
    		externalAccessLock.writeLock().unlock();
    	}
    	onSessionClosed();
    }