Skip to content

Commit

Permalink
manual rollbacks on MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed May 31, 2011
1 parent 498a6c4 commit 0223914
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions master/buildbot/db/buildrequests.py
Expand Up @@ -240,11 +240,17 @@ def thd(conn):
# if no rows or too few rows were updated, then we failed; this
# will roll back the transaction
if updated_rows != len(brids):
# MySQL doesn't do transactions, so roll this back manually
if conn.engine.dialect.name == 'mysql':
alreadyClaimed(conn, tmp)
transaction.rollback()
raise AlreadyClaimedError

transaction.commit()
except (sa.exc.ProgrammingError, sa.exc.IntegrityError):
# MySQL doesn't do transactions, so roll this back manually
if conn.engine.dialect.name == 'mysql':
alreadyClaimed(conn, tmp)
transaction.rollback()
raise AlreadyClaimedError

Expand Down

0 comments on commit 0223914

Please sign in to comment.