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 ; }
This method reads the existing database and offers the last revision id of the database