FirebirdSQL/fdb

Cursor fails after use with executemany(). ReferenceError: weakly-referenced object no longer exists [PYFB67]

firebird-automations opened this issue · 2 comments

Submitted by: Søren Nielsen (swn)

Cursor fails with "ReferenceError: weakly-referenced object no longer exists" after use with executemany().

The following program reproduced the error on both my systems. It worked using fdb 1.4.x.

-------------------------
import fdb

connection = fdb.create_database("CREATE DATABASE 'test.db' user 'SYSDBA' password 'masterkey'")

cursor = connection.cursor()

cursor.execute("CREATE TABLE TEST (ID INTEGER PRIMARY KEY)")
connection.commit()

cursor.executemany("INSERT INTO TEST VALUES(?)", [(1,), (2,)])
cursor.executemany("INSERT INTO TEST VALUES(?)", [(3,), (4,)])
-------------------------

Traceback (most recent call last):
File "C:\Users\swn\Programmering\tmp\fdb_weak_ref.py", line 14, in <module>
cursor.executemany("INSERT INTO TEST VALUES(?)", [(3,), (4,)])
File "C:\Program Files\Python35\lib\site-packages\fdb\http://fbcore.py", line 3625, in executemany
self.execute(operation, parameters)
File "C:\Program Files\Python35\lib\site-packages\fdb\http://fbcore.py", line 3564, in execute
if self._ps != None:
ReferenceError: weakly-referenced object no longer exists

Commits: c37c256 FirebirdSQL/fbt-repository@c507b0a

Modified by: @pcisar

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 1.6.1 [ 10753 ]

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]