[英]SQLAlchemy Oracle - InvalidRequestError: could not retrieve isolation level
I am having problems accessing tables in an Oracle database over a SQLAlchemy connection.我在通过 SQLAlchemy 连接访问 Oracle 数据库中的表时遇到问题。 Specifically, I am using Kedro
catalog.load('table_name')
and getting the error message Table table_name not found
.具体来说,我正在使用 Kedro
catalog.load('table_name')
并收到错误消息Table table_name not found
。 So I decided to test my connection using the method listed in this answer: How to verify SqlAlchemy engine object .因此,我决定使用此答案中列出的方法测试我的连接: 如何验证 SqlAlchemy 引擎 object 。
from sqlalchemy import create_engine
engine = create_engine('oracle+cx_oracle://USER:PASSWORD@HOST:PORT/?service_name=SERVICE_NAME')
engine.connect()
Error: InvalidRequestError: could not retrieve isolation level
错误:
InvalidRequestError: could not retrieve isolation level
I have tried explicitly adding an isolation level as explained in the documentation like this:我已尝试按照文档中的说明显式添加隔离级别,如下所示:
engine = create_engine('oracle+cx_oracle://USER:PASSWORD@HOST:PORT/?service_name=SERVICE_NAME', execution_options={'isolation_level': 'AUTOCOMMIT'})
and this:和这个:
engine.connect().execution_options(isolation_level='AUTOCOMMIT')
and this:和这个:
connection = engine.connect()
connection = connection.execution_options(
isolation_level="AUTOCOMMIT"
)
but I get the same error in all cases.但在所有情况下我都会遇到同样的错误。
Upgrading from SqlAlchemy 1.3.21 to 1.3.22 solved the problem.从 SqlAlchemy 1.3.21 升级到 1.3.22 解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.