python-oracledb
python-oracledb copied to clipboard
Thick mode: Connection.gettype error
-
What versions are you using?
platform.platform: Linux-6.5.9-arch2-1-x86_64-with-glibc2.38 sys.maxsize > 2**32: True platform.python_version: 3.11.5
oracledb.__version__: 1.4.2
-
Is it an error or a hang or a crash? Error
-
What error(s) or behavior you are seeing?
Connection.gettype()
is failing when usingThick mode
, however runs without error when usingThin mode
.Thick mode
:>>> connection.gettype("PDBADMIN.TESTTEST.STR_ARR") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.11/site-packages/oracledb/connection.py", line 437, in gettype obj_type_impl = self._impl.get_type(self, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "src/oracledb/impl/thick/connection.pyx", line 539, in oracledb.thick_impl.ThickConnImpl.get_type File "src/oracledb/impl/thick/utils.pyx", line 431, in oracledb.thick_impl._raise_from_odpi File "src/oracledb/impl/thick/utils.pyx", line 421, in oracledb.thick_impl._raise_from_info oracledb.exceptions.DatabaseError: ORA-04043: object PDBADMIN.TESTTEST.STR_ARR does not exist
Thin mode
:>>> connection.gettype("PDBADMIN.TESTTEST.STR_ARR") <oracledb.DbObjectType PDBADMIN.TESTTEST.STR_ARR>
- Does your application call init_oracle_client()? Yes
- Include a runnable Python script that shows the problem.
Start up a clean database:
Create a simple package:docker run \ --env ORACLE_PWD=password \ --interactive \ --publish 1521:1521 \ --rm \ --tty \ container-registry.oracle.com/database/express:21.3.0-xe
Try and runCREATE OR REPLACE PACKAGE PDBADMIN.TESTTEST AS TYPE STR_ARR IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER; END;
Connection.gettype()
on the type from the newly created package:import os import oracledb oracledb.init_oracle_client() # The script does not fail when commenting out this line (I.E. when using `thin mode`) connection = oracledb.connect( host="localhost", password="password", port=1521, service_name="XEPDB1", user="PDBADMIN", ) connection.gettype("PDBADMIN.TESTTEST.STR_ARR")
For me, python-oracledb Thin and Thick (and cx_Oracle 8.3) all fail with Oracle Instant Client 21.1 against Oracle DB 21.3 EE , but all work against Oracle DB Free 23.3.0.23.9.
Hello @cjbj, thank you for the report, I have also tried with an older version which produces the same error (again, only when using Thick
mode):
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
@hummeltech try a newer version!! :)
Haha, yes I did indeed try with newer versions (19c
& 21.3.0-xe
) and have the same problem there. The issue is that I need to work with multiple versions of the database and Thin mode doesn't support the older versions.
@hummeltech since the driver does work unchanged with the latest DB, I suspect you've hit some DB limitation that was removed in a new version. You'll probably need to think about work arounds.
However I'll leave this issue open until we can review what the driver is sending/getting via Thick mode Oracle Client libraries.
I just tried this myself using 19.15 and 21.6 clients against the XE database that you suggested and did not run into any difficulties with either thick or thin clients. Can you try with the latest instant clients (https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) and the latest version of python-oracledb (2.0.1) and let me know if you still have difficulties? Thanks!
Thanks for taking a look, I will try the new version!
Closing - no activity.