From a5c54449530aa558222a47354e7873b5203a3374 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 17 Mar 2011 14:13:05 +0100 Subject: closed #254 --- module/database/DatabaseBackend.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'module/database/DatabaseBackend.py') diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py index 02e09b3b3..9e9e73e43 100644 --- a/module/database/DatabaseBackend.py +++ b/module/database/DatabaseBackend.py @@ -16,8 +16,6 @@ @author: RaNaN @author: mkaay """ - -from threading import Lock from threading import Thread from threading import Event from os import remove @@ -97,7 +95,11 @@ class DatabaseJob(): try: self.result = self.f(*self.args, **self.kwargs) except Exception, e: - print "Database Error @", self.f.__name__, self.args[1:], self.kwargs, e + try: + print "Database Error @", self.f.__name__, self.args[1:], self.kwargs, e + except: + pass + print_exc() self.exception = e finally: @@ -147,10 +149,6 @@ class DatabaseBackend(Thread): self.conn.close() break j.processJob() - if j.exception: - self.conn.rollback() - else: - self.conn.commit() @style.queue def shutdown(self): @@ -259,6 +257,10 @@ class DatabaseBackend(Thread): @style.async def commit(self): self.conn.commit() + + @style.queue + def syncSave(self): + self.conn.commit() @style.async def rollback(self): -- cgit v1.2.3