All pastes #260903 Raw Edit

Smerp

public python v1 · immutable
#260903 ·published 2006-11-28 19:53 UTC
rendered paste body
        # lock the jobs using ownerId        try:            cu = self.db.transaction()             # <- dies here            cu.execute("""UPDATE Jobs SET owner=?                              WHERE owner IS NULL AND status=?""",                       ownerId, jobstatus.WAITING)            self.db.commit()        except sqlerrors.DatabaseLocked:             # do nothing if we fail to lock any rows; we'll be back...            self.db.rollback()            return 0        except:            # unhandled exception; pass it up            self.db.rollback()            raise