Method used by SessionFactory to invalidate current Session when the keyspace (used by current session) is deleted.
This closes current session and local transaction, without invoking callback function.
975989
void invalidate() {
        TransactionOLTP localTx = localOLTPTransactionContainer.get();
        if (localTx != null) {
            localTx.close(ErrorMessage.SESSION_CLOSED.getMessage(keyspace()));
            localOLTPTransactionContainer.set(null);
        }
        isClosed = true;
    }
1272762
def kill_current_session(ctx: Context_T) -> None:
    
    ctx_id = context_id(ctx)
    if ctx_id in _sessions:
        del _sessions[ctx_id]
168184
def _deregister(self, session):
        
        if session in self:
            self._sessions.pop(self._get_session_key(session), None)
308656
public void dropKeyspace(DBConn dbConn, String keyspace) {
        m_logger.info("Deleting Keyspace '{}'", keyspace);
        try {
            dbConn.getClientSession().system_drop_keyspace(keyspace);
            waitForSchemaPropagation(dbConn);
        } catch (Exception ex) {
            String errMsg = "Failed to delete Keyspace '" + keyspace + "'"; 
            m_logger.error(errMsg, ex);
            throw new RuntimeException(errMsg, ex);
        }
    }
1026684
def invalidate(self, key):
        """"""
        if key not in self.data:
            return
        del self.data[key]

        # Find all components that used it and invalidate their results
        for cname in self.components:
            if key in self.depends[cname]:
                for downstream_key in self.provides[cname]:
                    self.invalidate(downstream_key)
991125
def removeSessionWithKey(self, key):
        
        self.store.query(
            PersistentSession,
            PersistentSession.sessionKey == key).deleteFromStore()
38498
public KeyFactory reset() {
    setProjectId(pi);
    setNamespace(ns);
    kind = null;
    ancestors.clear();
    return this;
  }
222930
@Override
    public void invalidate() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Invalidating session; " + this);
        }
        this.valid = false;
        destroy();
    }
618857
public void invalidate() {
		this.appToken = null;
		this.appDBID = null;
		this.authorizer = null;
		this.intuitServiceType = null;
		this.realmID = null;
	}
484496
@Override
    public synchronized void invalidate() {

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[INVALIDATE], appNameAndIdString);
        }
        if (invalInProgress) {
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[INVALIDATE], "Invalidation in Progress");
            }
            return;
        }
        if (!_isValid) {
            throw new IllegalStateException();
        }
        invalInProgress = true;
        
        // PM03375: Remove duplicate call to sessionCacheDiscard for persistence case
        if (_smc.isUsingMemory()) {
            _storeCallback.sessionCacheDiscard(this);
        }
        _storeCallback.sessionInvalidated(this);
        _store.removeSession(_sessionId);

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[INVALIDATE], "_removeAttrOnInvalidate = " + _removeAttrOnInvalidate );
            if(_attributes != null) {
                LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[INVALIDATE], "session _attributes.size() = " + _attributes.size() );
            }
        }        
        
        //CTS defect expects removal of session attributes
        if(_attributes != null && _removeAttrOnInvalidate) {
            
           Enumeration<String> attrKey =  _attributes.keys();
           while(attrKey.hasMoreElements()){
               
               String key = attrKey.nextElement();
               this.removeAttribute(key);
           }                    
           if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
               LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[INVALIDATE], "session attributes removed");
           }
        }

        setIsValid(false);

        invalInProgress = false;
        _attributes = null;
        _attributeNames.clear();
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[INVALIDATE]);
        }
    }
1372687
private boolean hasKeySpace(boolean printError)
    {
        boolean hasKeyspace = keySpace != null;

        if (!hasKeyspace && printError)
            sessionState.err.println("Not authorized to a working keyspace.");

        return hasKeyspace;
    }
869249
public final void invalidateKey(Data key, String dataStructureName, String sourceUuid) {
        checkNotNull(key, "key cannot be null");
        checkNotNull(sourceUuid, "sourceUuid cannot be null");

        Invalidation invalidation = newKeyInvalidation(key, dataStructureName, sourceUuid);
        invalidateInternal(invalidation, getPartitionId(key));
    }
823113
protected final void closeSession() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            if (currentSession != null) {
                currentSession.close();
            }
        }
    }
995724
public void destroySession() {
    	JsonObject session = get("session");
        if (session == null) {
            return;
        }

        String sessionId = session.getString("id");
        // remove from the context
        put("session", null);

        if (sessionId == null) {
            return;
        }

        store.destroy(sessionId, new Handler<Object>() {
            @Override
            public void handle(Object error) {
                if (error != null) {
                    // TODO: better handling of errors
                    System.err.println(error);
                }
            }
        });
    }
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();
  }
932806
private void internalCleanup()
    {
        if(hasBroker())
        {
            PersistenceBroker broker = getBroker();
            if(log.isDebugEnabled())
            {
                log.debug("Do internal cleanup and close the internal used connection without" +
                        " closing the used broker");
            }
            ConnectionManagerIF cm = broker.serviceConnectionManager();
            if(cm.isInLocalTransaction())
            {
                /*
                arminw:
                in managed environment this call will be ignored because, the JTA transaction
                manager control the connection status. But to make connectionManager happy we
                have to complete the "local tx" of the connectionManager before release the
                connection
                */
                cm.localCommit();
            }
            cm.releaseConnection();
        }
    }
185220
protected final void invalidateAllKeysInNearCaches() {
        if (mapContainer.hasInvalidationListener()) {

            int partitionId = getPartitionId();
            Invalidator invalidator = getNearCacheInvalidator();

            if (partitionId == getNodeEngine().getPartitionService().getPartitionId(name)) {
                invalidator.invalidateAllKeys(name, getCallerUuid());
            }

            invalidator.resetPartitionMetaData(name, getPartitionId());
        }
    }