baztian / jaydebeapi

JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2.0 to that database.
GNU Lesser General Public License v3.0
365 stars 148 forks source link

can't have two cursors on same connection #224

Open roettker opened 1 year ago

roettker commented 1 year ago

I opened two cursors on the same db connection cursor1 = dgh01.cursor() cursor2 = dgh01.cursor() Then I excute an sql on each of them: cursor1.execute("select id from contracts where id = 100247") cursor2.execute("select id from contracts where id = 100247") if I now do a cursor1.fetchall I get a

java.sql.SQLException: java.sql.SQLException: The result set is closed (see below)

As I remember from perl DBI it was possible to act with two cursors on the same DB-connection.


Exception Traceback (most recent call last) File AbstractResultSet.java:362, in org.firebirdsql.jdbc.AbstractResultSet.next()

Exception: Java Exception

The above exception was the direct cause of the following exception:

java.sql.SQLException Traceback (most recent call last) Input In [198], in <cell line: 1>() ----> 1 cursor1.fetchall()

File ~/.local/lib/python3.9/site-packages/jaydebeapi/init.py:593, in Cursor.fetchall(self) 591 rows = [] 592 while True: --> 593 row = self.fetchone() 594 if row is None: 595 break

File ~/.local/lib/python3.9/site-packages/jaydebeapi/init.py:559, in Cursor.fetchone(self) 557 if not self._rs: 558 raise Error() --> 559 if not self._rs.next(): 560 return None 561 row = []

java.sql.SQLException: java.sql.SQLException: The result set is closed