Reputation: 2410
When I use oracledb Python module in Thick mode, I get a Segmentation fault
error on a huge database request with Oracle v11.2 client.
Code:
# main.py
import oracledb
oracledb.init_oracle(lib_dir='path/to/lib', config_dir='path/to/config')
connection = oracledb.connect(user='user', password='pwd', dsn=cs, sid=sid, encoding='utf-8')
cursor = connection.cursor()
cur.arraysize = 100
results = cur.execute('SELECT * FROM MY_TABLE')
Error:
python main.py
Segmentation fault
What is the problem with this request?
Upvotes: 0
Views: 420
Reputation: 2410
It may be a bug in your Oracle Client version at the C level.
To correct it, try to set the ORA_OCI_NO_OPTIMIZED_FETCH
environnement variable to 1
in order to disable fetch Oracle compression - which can make your code failed- before running your Python code:
export ORA_OCI_NO_OPTIMIZED_FETCH=1
python main.py
You can also try to update your Oracle client because this bug is probably fix in a more recent version or patch.
Upvotes: -1