--- hamster/db.py.orig 2010-10-26 12:19:38.000000000 +0300 +++ hamster/db.py 2010-10-26 12:20:00.000000000 +0300 @@ -918,7 +918,11 @@ for state, param in zip(statement, params): logging.debug("%s %s" % (state, param)) - cur.execute(state, param) + try: + cur.execute(state, param) + except: + cur = con.cursor() + cur.execute(state, param) if not self.__con: con.commit()