Update of /cvsroot/jython/jython/Lib/test/zxjdbc
In directory usw-pr-cvs1:/tmp/cvs-serv29788/Lib/test/zxjdbc
Modified Files:
zxtest.py
Log Message:
close open cursors when the connection closes
Index: zxtest.py
===================================================================
RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** zxtest.py 14 Jan 2002 04:28:41 -0000 1.10
--- zxtest.py 26 Mar 2002 02:46:36 -0000 1.11
***************
*** 43,46 ****
--- 43,47 ----
try:
c.execute("drop table zxtesting")
+ self.db.commit()
except:
self.db.rollback()
***************
*** 48,51 ****
--- 49,53 ----
try:
c.execute("create table zxtesting (id int not null, name varchar(32), state varchar(32), primary key (id))")
+ self.db.commit()
c.execute("insert into zxtesting (id, name, state) values (1, 'test0', 'il')")
c.execute("insert into zxtesting (id, name, state) values (2, 'test1', 'wi')")
***************
*** 132,135 ****
--- 134,149 ----
c.close()
self.assertRaises(zxJDBC.InternalError, c.execute, ("select * from zxtesting",))
+
+ def testClosingConnectionWithOpenCursors(self):
+ """testing that a closed connection closes any open cursors"""
+ c = self.cursor()
+ d = self.cursor()
+ e = self.cursor()
+ self.db.close()
+ # open a new connection so the tearDown can run
+ self.db = self.connect()
+ self.assertRaises(zxJDBC.InternalError, c.execute, ("select * from zxtesting",))
+ self.assertRaises(zxJDBC.InternalError, d.execute, ("select * from zxtesting",))
+ self.assertRaises(zxJDBC.InternalError, e.execute, ("select * from zxtesting",))
def testNativeSQL(self):
|