code: protected void checkCacheVersion() {
          // Be very aggressive in invalidating the cache.
          boolean invalidate = true;
          QueryRunner run = new QueryRunner(ds);
          try {
              long latestVersion = run.query("SELECT version FROM gw_dataversion", Handlers.LONG_HANDLER); //$NON-NLS-1$
              if (latestVersion > -1 && dataVersion > -1 && latestVersion == dataVersion) {
                  invalidate = false;
              } else {
                  dataVersion = latestVersion;
              }
          } catch (SQLException e) {
              // TODO need to use the gateway logger to log this!
              e.printStackTrace();
          }
          if (invalidate) {
              invalidateCache();
          }
      }
docs: Checks the ES store to see if the 'dataVersion' entry has been updated with a newer
  version #.  If it has, then we need to invalidate our cache.