  * Unload configuration. This is useful for tests, but it should not called
  * used in production.
  */
-ALTER MODULE LOGGER PUBLISH --TODO ADD
+ALTER MODULE LOGGER ADD
   PROCEDURE UNLOAD_CONF (
   )
   LANGUAGE SQL

 P_ACT_CACHE: BEGIN
  DECLARE VAL ANCHOR LOGDATA.CONFIGURATION.VALUE;

  -- Check that the configuration variable is true
  SELECT VALUE INTO VAL
    FROM LOGDATA.CONFIGURATION
	WHERE KEY = INTERNAL_CACHE;
  IF (VAL <> 'true') THEN
   SIGNAL SQLSTATE VALUE 'LG002'
     SET MESSAGE_TEXT = 'Invalid configuration state';
  END IF;
  SET CACHE = TRUE;
  SET LOADED = FALSE;
  -- Cleans the cache

   IF (COALESCE(LAST_REFRESH, EPOCH) + SECS SECONDS < CURRENT TIMESTAMP OR LOADED = FALSE) THEN
    -- Refreshes the configuration
	CALL LOGGER.REFRESH_CONF ();
    SET LOADED = TRUE;
   END IF;

