def __milia_change_tenant!( tid )
    old_id = ( Thread.current[:tenant_id].nil? ? '%' : Thread.current[:tenant_id] )
    new_id = ( tid.nil? ? '%' : tid.to_s )
    Thread.current[:tenant_id] = tid
    session[:tenant_id] = tid  # remember it going forward
    logger.debug("MILIA >>>>> [change tenant] new: #{new_id}\told: #{old_id}") unless logger.nil?
  end
def __milia_change_tenant!( tid )
    old_id = ( Thread.current[:tenant_id].nil? ? '%' : Thread.current[:tenant_id] )
    new_id = ( tid.nil? ? '%' : tid.to_s )
    Thread.current[:tenant_id] = tid
    session[:tenant_id] = tid  # remember it going forward
    logger.debug("MILIA >>>>> [change tenant] new: #{new_id}\told: #{old_id}") unless logger.nil?
  end
------------------------------------------------------------------------------
 ------------------------------------------------------------------------------