Remove an enrollment from the session.

    This function removes from the session the given enrollment.

    :param session: database session
    :param enrollment: enrollment to remove
15654
def delete_enrollment(session, enrollment):
    
    uidentity = enrollment.uidentity
    uidentity.last_modified = datetime.datetime.utcnow()

    session.delete(enrollment)
    session.flush()
356956
public void removeHttpSession(HttpSession session) {
		if (session == activeSession) {
			activeSession = null;
		}
		synchronized (this.sessions) {
			this.sessions.remove(session);
		}
		this.model.removeHttpSession(session);
		session.invalidate();
	}
991125
def removeSessionWithKey(self, key):
        
        self.store.query(
            PersistentSession,
            PersistentSession.sessionKey == key).deleteFromStore()
199975
def delete(self, response, **kwargs):
        '''
        
        '''
        response_cls = self._get_instance(**kwargs)
        if response_cls:
            _action_and_commit(response_cls, session.delete)
683106
def _del_all_subscriptions(self, session):
        
        filter_queue = deque()
        for topic in self._subscriptions:
            if self._del_subscription(topic, session):
                filter_queue.append(topic)
        for topic in filter_queue:
            if not self._subscriptions[topic]:
                del self._subscriptions[topic]
317506
def disconnect
    @connection_pool.disconnect!
    SugarCRM::Module.deregister_all(self)
    namespace = @namespace
    SugarCRM.instance_eval{ remove_const namespace } # remove NamespaceX from SugarCRM
    SugarCRM.remove_session(self)
  end
341826
public static void close(Session session) {
		if (session != null && session.isConnected()) {
			session.disconnect();
		}
		JschSessionPool.INSTANCE.remove(session);
	}
600469
def remove(self, option):
		
		if option.__class__ == Option:
			if option in self.options:
				del self.options[self.options.index(option)]
			else:
				raise OptionNotFoundError(option.name)
		else:
			raise TypeError("invalid type supplied")
322510
def remove(self):
        
        session = client.get_client().create_session()

        if not self._base_query(session).count() > 0:
            session.close()
            raise RuntimeError("Target does not exist, name={:s}, params={:s}"
                               "".format(self.name, self.params))

        # remove the target from the database
        self._base_query(session).delete()
        session.commit()

        session.close()
437425
def clear_data(self, request):
        
        for key in request.session.keys():
            if key.startswith(constants.SESSION_KEY):
                del request.session[key]
716132
def remove(self, name):
        
        init = self._get_implementation(name)
        self._assert_service_installed(init, name)
        logger.info('Removing %s service %s...', self.init_system, name)
        init.stop()
        init.uninstall()
        logger.info('Service removed')
503877
def put(self, session):
        
        try:
            self._sessions.put_nowait(session)
        except queue.Full:
            try:
                session.delete()
            except NotFound:
                pass
1026111
public void removeAllSessions() {		
		List<SipSessionKey> sipSessionsToRemove = new ArrayList<SipSessionKey>(); 
		for (SipSessionKey sipSessionKey : sipSessions.keySet()) {
			sipSessionsToRemove.add(sipSessionKey);
		}
		for (SipSessionKey sipSessionKey : sipSessionsToRemove) {
			removeSipSession(sipSessionKey);
		}
		List<SipApplicationSessionKey> sipApplicationSessionsToRemove = new ArrayList<SipApplicationSessionKey>(); 
		for (SipApplicationSessionKey sipApplicationSessionKey : sipApplicationSessions.keySet()) {
			sipApplicationSessionsToRemove.add(sipApplicationSessionKey);
		}
		for (SipApplicationSessionKey sipApplicationSessionKey : sipApplicationSessionsToRemove) {
			removeSipApplicationSession(sipApplicationSessionKey);
		}				
	}
215435
def delete_record(self, record):
        
        try:
            self.session.delete(record)
            self.session.commit()
        except Exception as e:
            self.session.rollback()
            raise ProgrammingError(e)
        finally:
            self.session.close()
638672
public final void unregisterSession( AbstractSession sessionToRemove )
    {
        if (sessions.remove(sessionToRemove.getId()) == null)
            log.warn("Unknown session : "+sessionToRemove);
    }
898249
def remove(self, value, session=None):
        ''''''
        s, instance = self.session_instance('remove', value, session)
        # update state so that the instance does look persistent
        instance.get_state(iid=instance.pkvalue(), action='update')
        return s.delete(instance)
322649
def disconnect(self):
        
        if self.r_session:
            self.session_logout()

        self.r_session = None
        self.clear()