def _increment_provider_generation(conn, rp):
 rp_gen = rp.generation
 new_generation = (rp_gen + 1)
 upd_stmt = _RP_TBL.update().where(sa.and_((_RP_TBL.c.id == rp.id), (_RP_TBL.c.generation == rp_gen))).values(generation=new_generation)
 res = conn.execute(upd_stmt)
 if (res.rowcount != 1):
  raise exception.ConcurrentUpdateDetected
 return new_generation

def _increment_provider_generation ( conn , rp ) : rp_gen = rp . generation new_generation = ( rp_gen + 1 ) upd_stmt = _RP_TBL . update ( ) . where ( sa . and_ ( ( _RP_TBL . c . id == rp . id ) , ( _RP_TBL . c . generation == rp_gen ) ) ) . values ( generation = new_generation ) res = conn . execute ( upd_stmt ) if ( res . rowcount != 1 ) : raise exception . ConcurrentUpdateDetected return new_generation
increments the supplied providers generation value .