Skip to content

Can't close connection after query with LOB result #108

@mcs07

Description

@mcs07

With cx_Oracle 6.0.3, I can't figure out how to close a connection after making a query with a LOB result. Even if I make sure to close the cursor, and delete the LOB object or call close() on it, I still get DPI-1054: connection cannot be closed when open statements or LOBs exist.

What's the best way to ensure everything is closed so the connection can be closed?

conn = cx_Oracle.connect(dsn)
cursor = conn.cursor()
id, my_lob = cursor.execute(...).fetchone()
result_string = my_lob.read()
# Need to close LOB. How?
del my_lob
cursor.close()
conn.close()  # Always fails

Python 2.7 64bit
cx_Oracle 6.0.3
oracle-instantclient 11.2.0.4.0
Windows 10

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