From: Mark Huang Date: Fri, 13 Oct 2006 20:00:37 +0000 (+0000) Subject: - close cursor before attempting rollback X-Git-Tag: pycurl-7_13_1~581 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fb2ccf2ea4abb04b21dd1fb7e14f4512ee3f4c34;p=plcapi.git - close cursor before attempting rollback --- diff --git a/PLC/PostgreSQL.py b/PLC/PostgreSQL.py index 7fe5ad2d..5ca0caa9 100644 --- a/PLC/PostgreSQL.py +++ b/PLC/PostgreSQL.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: PostgreSQL.py,v 1.2 2006/09/25 15:12:20 mlhuang Exp $ +# $Id: PostgreSQL.py,v 1.3 2006/10/03 19:27:07 mlhuang Exp $ # import pgdb @@ -100,6 +100,7 @@ class PostgreSQL: (self.rowcount, self.description, self.lastrowid) = \ (cursor.rowcount, cursor.description, cursor.lastrowid) except pgdb.DatabaseError, e: + cursor.close() self.rollback() uuid = commands.getoutput("uuidgen") print >> log, "Database error %s:" % uuid