|
From: brian z. <bz...@us...> - 2002-04-21 14:22:18
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7571/Lib Modified Files: dbexts.py Log Message: prepared statements can live outside the cursor Index: dbexts.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/dbexts.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dbexts.py 19 Apr 2002 19:01:06 -0000 1.6 --- dbexts.py 21 Apr 2002 14:22:15 -0000 1.7 *************** *** 261,265 **** return c ! def commit(self, cursor=None): """ commit the cursor and create the result set """ if cursor and cursor.description: --- 261,265 ---- return c ! def commit(self, cursor=None, close=1): """ commit the cursor and create the result set """ if cursor and cursor.description: *************** *** 276,281 **** if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount ! if not self.autocommit or cursor is None: self.db.commit() ! if cursor: cursor.close() def rollback(self): --- 276,283 ---- if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount ! if not self.autocommit or cursor is None: ! if not self.db.autocommit: ! self.db.commit() ! if cursor and close: cursor.close() def rollback(self): *************** *** 312,316 **** cur.execute(sql, maxrows=maxrows) finally: ! self.commit(cur) def isql(self, sql, params=None, bindings=None, maxrows=None): --- 314,318 ---- cur.execute(sql, maxrows=maxrows) finally: ! self.commit(cur, close=isinstance(sql, StringType)) def isql(self, sql, params=None, bindings=None, maxrows=None): |