From e9fb760fa321aad9e7566115a78a2b2f9501bd48 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 4 Nov 2016 06:45:39 -0500 Subject: [PATCH] Only rollback for database locked raise error for everything else, we should put in place a file that will keep itemids we had to rollback on. To review later. --- resources/lib/database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/database.py b/resources/lib/database.py index 02a80f8b..9a004ded 100644 --- a/resources/lib/database.py +++ b/resources/lib/database.py @@ -88,8 +88,9 @@ class DatabaseConn(object): if exc_type is not None: # Errors were raised in the with statement log.error("rollback: Type: %s Value: %s", exc_type, exc_val) - self.conn.rollback() - if not "database is locked" in exc_val: + if "database is locked" in exc_val: + self.conn.rollback() + else: raise elif self.commit_mode is not None and changes: