code: public long getLastRevision(final String resourceName) throws JaxRxException, TTException {
  
          long lastRevision;
          if (mDatabase.existsResource(resourceName)) {
              ISession session = null;
              try {
                  session = mDatabase.getSession(new SessionConfiguration(resourceName, StandardSettings.KEY));
                  lastRevision = session.getMostRecentVersion();
              } catch (final Exception globExcep) {
                  throw new JaxRxException(globExcep);
              } finally {
                  session.close();
              }
          } else {
              throw new JaxRxException(404, "Resource not found");
          }
          return lastRevision;
  
      }
docs: This method reads the existing database, and offers the last revision id
  of the database
  
  @param resourceName
  The name of the existing database.
  @return The {@link OutputStream} containing the result
  @throws WebApplicationException
  The Exception occurred.
  @throws TTException