Change-Id: I227bbb46fbcbae1f60d3f5bb4dd2b9f41ca3dd0c
def id_generator(ctx):
# in reality, might want to use a separate transaction for this.
- with db1.connect() as conn:
+ with db1.begin() as conn:
nextid = conn.scalar(ids.select().with_for_update())
conn.execute(ids.update().values({ids.c.nextid: ids.c.nextid + 1}))
return nextid
def id_generator(ctx):
# in reality, might want to use a separate transaction for this.
- with engine.connect() as conn:
+ with engine.begin() as conn:
nextid = conn.scalar(ids.select().with_for_update())
conn.execute(ids.update().values({ids.c.nextid: ids.c.nextid + 1}))
return nextid