我关注this官方指南并尝试在我的代码中设置隔离级别,如下所示:
import fdb
cnx = fdb.connect(....)
cursor = cnx.cursor()
cursor.execute("SET TRANSACTION ISOLATION LEVEL READ COMMITTED NO RECORD_VERSION")
但是在控制台中运行此代码会导致出现以下错误消息:
File "<stdin>", line 1, in <module>
File "C:\data\fdb\fdb\fbcore.py", line 3574, in execute
self._ps._execute(parameters)
File "C:\data\fdb\fdb\fbcore.py", line 3291, in _execute
"Error while executing SQL statement:")]
fdb.fbcore.DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -901\n-
invalid transaction handle (expecting explicit transaction start)', -901, 335544332)
我不确定这有什么问题,我该如何解决。