- ignore rollback errors
[plcapi.git] / PLC / PostgreSQL.py
index 5ca0caa..069d944 100644 (file)
@@ -5,7 +5,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: PostgreSQL.py,v 1.3 2006/10/03 19:27:07 mlhuang Exp $
+# $Id: PostgreSQL.py,v 1.4 2006/10/13 20:00:37 mlhuang Exp $
 #
 
 import pgdb
@@ -100,8 +100,10 @@ class PostgreSQL:
             (self.rowcount, self.description, self.lastrowid) = \
                             (cursor.rowcount, cursor.description, cursor.lastrowid)
         except pgdb.DatabaseError, e:
-            cursor.close()
-            self.rollback()
+            try:
+                self.rollback()
+            except:
+                pass
             uuid = commands.getoutput("uuidgen")
             print >> log, "Database error %s:" % uuid
             print >> log, e