From: Billy G. A. <bal...@us...> - 2001-09-18 19:23:37
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv7560 Modified Files: PgSQL.py Log Message: 18SEP2001 bga [Feature Request #462588] Cursor.close() no longer rollbacks the open transaction when the last cursor is closed. Index: PgSQL.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/PgSQL.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PgSQL.py 2001/09/03 04:43:31 1.18 --- PgSQL.py 2001/09/18 19:23:35 1.19 *************** *** 30,33 **** --- 30,36 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 18SEP2001 bga [Feature Request #462588] Cursor.close() no longer ends | + # (rollback) the open transaction when the last cursor is | + # closed. | # 03SEP2001 gh Fixed several cases of references to non-existing | # globals in PgMoney. | *************** *** 36,40 **** # attribute is now built on the first successful select | # or cursor fetch. | ! # 23AUG2001 bga [Bug #454653]Change the code to rollback an open trans- | # action, if any, when the last cursor of a connection is | # closed. | --- 39,43 ---- # attribute is now built on the first successful select | # or cursor fetch. | ! # 23AUG2001 bga [Bug #454653] Change the code to rollback an open trans-| # action, if any, when the last cursor of a connection is | # closed. | *************** *** 1559,1571 **** raise AttributeError, \ "Can't change autocommit when a cursor is active." - else: - # It's possible that the connection can still have an open - # transaction, even though there are no active cursors. This - # will only happen with weak references when the cursors have - # been deleted but not garbage collected. We will issue a - # rollback if this is the case. ! if self.inTransaction: ! self.rollback() if value: --- 1562,1571 ---- raise AttributeError, \ "Can't change autocommit when a cursor is active." ! # It's possible that the connection can still have an open ! # transaction, even though there are no active cursors. ! ! if self.inTransaction: ! self.rollback() if value: *************** *** 2040,2053 **** if noWeakRef: _cc.remove(self) ! anyLeft = len(_cc) > 0 ! if (anyLeft): # We have additional cursors, garbage collect them. _cc._Connection__gcCursors() else: del _cc.data[id(self)] - anyLeft = len(_cc.data.keys()) > 0 - - if not (anyLeft and self.conn.inTransaction): - self.conn.rollback() except: pass --- 2040,2048 ---- if noWeakRef: _cc.remove(self) ! if (len(_cc) > 0): # We have additional cursors, garbage collect them. _cc._Connection__gcCursors() else: del _cc.data[id(self)] except: pass |