def peekID ( self ):
    
    with closing(self.conn.cursor()) as cursor:

      # Query the current max identifier
      sql = "SELECT max(id) FROM " + str ( self.proj.getIdsTable() )
      try:
        cursor.execute ( sql )
      except MySQLdb.Error, e:
        logger.warning ("Problem retrieving identifier {}: {}. sql={}".format(e.args[0], e.args[1], sql))
        raise

      # Here we've queried the highest id successfully    
      row = cursor.fetchone()
      # if the table is empty start at 1, 0 is no annotation
      if ( row[0] == None ):
        identifier = 1
      else:
        identifier = int ( row[0] ) + 1

      return identifier
Look at the next ID but don't claim it.  This is an internal interface.
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcadb.py/OCPCADB.peekID