def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: pass except Exception,ex: raise ex
def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: pass except Exception, ex: raise ex
def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: return cursor except: conn.close() cursor = conn.cursor() cld(cursor, sql, conn) return cursor
def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: return cursor except: conn.close() cursor=conn.cursor() cld(cursor, sql, conn) return cursor
from traceback import print_exc def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: pass except Exception,ex: raise ex except: print_exc() print "try again" conn._rollback() conn.close() cursor=conn.cursor() cld(cursor, sql, conn) return cursor def parseAOpLogData(device, conn, cursor, lines): print "user or op lines count:", len(lines) c=0; ec=0; try: user=False for line in lines: try: if line: user=lineToUser(cursor,device,line) c=c+1 except Exception,e: ec=ec+1
def commitLog(conn, cursor, sql): try: cld(cursor, sql, conn) except IntegrityError: pass except Exception, ex: raise ex except: print_exc() print 'try again' conn._rollback() conn.close() cursor = conn.cursor() cld(cursor, sql, conn) return cursor def parseAOpLogData(device, conn, cursor, lines): print 'user or op lines count:', len(lines) c = 0 ec = 0 try: user = False for line in lines: try: if line: user = lineToUser(cursor, device, line) c = c + 1