Skip to content

Thin mode: connection.gettype error #123

Closed
@ivba7

Description

@ivba7

oracle 19.0.0.0.0
platform.platform: Linux-4.18.0-425.3.1.el8.x86_64-x86_64-with-glibc2.2.5
sys.maxsize > 2**32: True
platform.python_version: 3.8.13
oracledb.version: 1.2.1

Error my_type_1 = tpm_db.conn.gettype(
'TPM.TEST_TYPES.TBL_REC_TRANSACTIONS1')

Traceback (most recent call last):
File "test_db_gettype.py", line 19, in
my_type_1 = tpm_db.conn.gettype(
File "/home/r432107/myenv38/lib64/python3.8/site-packages/oracledb/connection.py", line 441, in gettype
obj_type_impl = self._impl.get_type(self, name)
File "src/oracledb/impl/thin/connection.pyx", line 361, in oracledb.thin_impl.ThinConnImpl.get_type
File "src/oracledb/impl/thin/dbobject.pyx", line 897, in oracledb.thin_impl.ThinDbObjectTypeCache.get_type
File "src/oracledb/impl/thin/dbobject.pyx", line 953, in oracledb.thin_impl.ThinDbObjectTypeCache.populate_partial_types
File "src/oracledb/impl/thin/dbobject.pyx", line 860, in oracledb.thin_impl.ThinDbObjectTypeCache._populate_type_info
File "src/oracledb/impl/thin/dbobject.pyx", line 834, in oracledb.thin_impl.ThinDbObjectTypeCache._parse_tds
File "src/oracledb/impl/thin/dbobject.pyx", line 782, in oracledb.thin_impl.ThinDbObjectTypeCache._parse_element_type
File "src/oracledb/impl/thin/dbobject.pyx", line 683, in oracledb.thin_impl.ThinDbObjectTypeCache._determine_element_objtype
TypeError: 'NoneType' object is not iterable

  1. Does your application call init_oracle_client()?
    No

  2. Include a runnable Python script that shows the problem.

import common.db as dba
import traceback
import sys
import platform

print("platform.platform:", platform.platform())
print("sys.maxsize > 2**32:", sys.maxsize > 2**32)
print("platform.python_version:", platform.python_version())

import oracledb
print("oracledb.__version__:", oracledb.__version__)


tpm_db = dba.Db(
    'D00TPMOUT', 'xxxx', 'xxx.dctest.slsp.sk:1537/RSKD2TP2', 'utf-8', 1, 1, '')
cur = tpm_db.cursor()

try:
    my_type_1 = tpm_db.conn.gettype(
                'TPM.TEST_TYPES.TBL_REC_TRANSACTIONS1')

    print(f'my_type_1:[{my_type_1}]')
except Exception:
    print(traceback.format_exc(1000))

try:
    my_type= tpm_db.conn.gettype(
                'TPM.TEST_TYPES.TBL_REC_PAY24STS')
    print(f'my_type:[{my_type}]')
except Exception:
    print(traceback.format_exc(1000))
CREATE OR REPLACE PACKAGE test_types
AS
 
    
    SUBTYPE rec_transaction IS transactions_ntf_test%ROWTYPE;
    
    TYPE tbl_rec_transactions1 IS TABLE OF rec_transaction INDEX BY BINARY_INTEGER; 
    
    
    
    TYPE rec_pay24sts IS RECORD(CHANNEL_REF_NO VARCHAR2(50),
                                SRC_CHANNEL VARCHAR2(10),
                                SRC_SYSTEM VARCHAR2(10),
                                IBAN VARCHAR2(34),
                                STATUS VARCHAR2(1),
                                STATUS_DESC VARCHAR2(4000),
                                MSG_ORIG VARCHAR2(4000),
                                MSG_CONV VARCHAR2(32000),
                                SERVICE_NAME VARCHAR2(64),
                                MSG_TYPE VARCHAR2(64),
                                MSG_FORMAT VARCHAR2(8));
                                
    TYPE tbl_rec_pay24sts IS TABLE OF rec_pay24sts INDEX BY BINARY_INTEGER; 
END;
/
GRANT EXECUTE ON test_types TO D00TPMOUT
/

CREATE TABLE transactions_ntf_test
    (seq_no NUMBER ,
    tran_date DATE,
    tran_type VARCHAR2(4 BYTE))
/

GRANT SELECT ON transactions_ntf_test TO D00TPMOUT
/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions