Python-oracledb 1.4 improves connection pool growth

Christopher Jones
Oracle Developers
Published in
2 min readAug 17, 2023

python-oracledb 1.4, the extremely popular Oracle Database interface for Python, is now on PyPI.

Photo by Ankush Minda on Unsplash

python-oracledb is an open source package for the Python Database API specification with many additions to support advanced Oracle Database features. It is the new name for the cx_Oracle driver.

Main Changes

  • A number of improvements to Thin mode connection management have been made. In particular connection pool growth and shrinkage behavior has been improved. (This is effectively similar to existing Thick mode functionality).
  • There is support for the newish database CONNECTION_ID feature which can be used to correlate tracing of connection attempts in client application messages and database logs.
  • Some new SODA functionality for indexes and locking has arrived.
  • There’s an opt-in ease-of-use improvement for queries from columns defined with the 12c-era “IS JSON” constraint, letting python-oracledb automatically identify that the data is in JSON form so you don’t need to do an explicit conversion in your application.
  • There is a cursor metadata change to give more information, and a related change to output type handlers. The old functionality will still work.
  • Outconverters can now optionally be called if data contains NULLs, making it easier, for example for you to map NULLs to empty strings.
  • In Thin mode, database error messages will now show a URL to the Oracle documentation about the error. (The same will be shown in Thick mode when using some future Oracle Client 23c libraries)
  • Thin mode now reads the ORA_SDTZ environment variable like Thick mode.
  • Users of Python 3.6 and 3.7 will now see a deprecation warning about these obsolete Python versions. These can be suppressed with code like:
import warnings
warnings.filterwarnings(action='ignore', module="oracledb")
import oracledb
  • For users building from source code, support for Cython 3 was added.

See the Release Notes for more improvements and bug fixes.

Installing or Upgrading python-oracledb

You can install or upgrade python-oracledb by running:

python -m pip install oracledb --upgrade

The pip options --proxy and --user may be useful in some environments. See python-oracledb Installation for details.

python-oracledb References

Home page: oracle.github.io/python-oracledb/index.html

Installation instructions: python-oracledb.readthedocs.io/en/latest/installation.html

Documentation: python-oracledb.readthedocs.io/en/latest/index.html

Release Notes: python-oracledb.readthedocs.io/en/latest/release_notes.html

Discussions: github.com/oracle/python-oracledb/discussions

Issues: github.com/oracle/python-oracledb/issues

Source Code Repository: github.com/oracle/python-oracledb

--

--

Christopher Jones
Oracle Developers

Oracle Database Product Manager for language drivers including Python python-oracledb, Node.js node-oracledb, PHP OCI8 and more! On Mastodon: @cjbj@phpc.social