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
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
log out from SugarCRM and cleanup (deregister modules, remove session, etc.)