<div dir="ltr"><div>What is cx_Oracle?</div><div><br></div><div>cx_Oracle is a Python extension module that enables access to Oracle Database for Python 3.x and 2.x and conforms to the Python database API 2.0 specifications with a number of enhancements.</div><div><br></div><div><br></div><div>Where do I get it?</div><div><a href="https://oracle.github.io/python-cx_Oracle" target="_blank">https://oracle.github.io/pytho<wbr>n-cx_Oracle</a></div><div><br></div><div>The easiest method to install cx_Oracle 6.0 is via pip as in</div><div><br></div><div>    python -m pip install cx_Oracle --upgrade</div><div><br></div><div><br></div><div>What's new since 5.3?</div><div><br></div><div>This is the first production release of version 6.0. The complete release notes can be found here: <a href="http://cx-oracle.readthedocs.io/en/latest/releasenotes.html#version-6-0-august-2017" target="_blank">http://cx-oracle.readthe<wbr>docs.io/en/latest/releasenotes<wbr>.html#version-6-0-august-2017</a>.</div><div><br></div><div>A summary of the changes compared to version 5.3 is found below:</div><div><br></div><div><b><u>Highlighted Enhancements</u></b></div><div><br></div><div>- Has been re-implemented to use the new ODPI-C (<a href="https://oracle.github.io/odpi" target="_blank">https://oracle.github.io/odpi</a><wbr>) abstraction layer for Oracle Database. The cx_Oracle API is unchanged. The cx_Oracle design, build and linking process has improved because of ODPI-C.</div><div><br></div><div>- Now has Python Wheels available for install. This is made possible by the ODPI-C architecture. Windows installers and Linux RPMs are no longer produced since PyPI no longer supports them.</div><div><br></div><div>- Has less code in Python's Global Interpreter Lock, giving better scalability.</div><div><div><br></div><div>- Added support for universal rowids. <br><br>- Added support for DML returning of multiple rows.<br></div><div><br></div><div>- Now associates LOB locators to LOB objects so they are not overwritten on database round trips.<br></div></div><div><br></div><div><b><u>Installation Changes</u></b></div><div><div><br></div><div>- On Linux, cx_Oracle 6 no longer uses instant client RPMs automatically. You must set LD_LIBRARY_PATH or use ldconfig to locate the Oracle Client library.</div><div><br></div><div>- On platforms other than Windows, if ORACLE_HOME is set (in a database or full client installation), remove requirement to set LD_LIBRARY_PATH in order to locate the Oracle Client library (<a class="gmail-m_-9077529093058346402m_-7827412571390462889gmail-moz-txt-link-freetext" href="https://github.com/oracle/odpi/issues/20" target="_blank">https://github.com/oracle/odp<wbr>i/issues/20</a>).</div><div><br></div></div><div><b><u>Connection Management Enhancements</u></b></div><div><br></div><div>- Prevent closing the connection when there are any open statements or LOBs and add new error "DPI-1054: connection cannot be closed when open statements or LOBs exist" when this situation is detected; this is needed to prevent crashes under certain conditions when statements or LOBs are being acted upon while at the same time (in another thread) a connection is being closed; it also prevents leaks of statements and LOBs when a connection is returned to a session pool. <br></div><div><br></div><div>- Added attribute SessionPool.stmtcachesize to support getting and 
setting the default statement cache size for connections in the pool. <br></div><div>
<br>- Added attribute Connection.dbop to support setting the database 
operation that is to be monitored.
<br>
<br>- Added attribute Connection.handle to facilitate testing the creation 
of a connection using a OCI service context handle.
<br>
<br>- Added parameters tag and matchanytag to the cx_Oracle.connect and 
SessionPool.acquire methods and added parameters tag and retag to the 
SessionPool.release method in order to support session tagging.
<br>
<br>- Added parameter edition to the cx_Oracle.SessionPool method.
<br><br>- Added parameters region, sharding_key and super_sharding_key to the cx_Oracle.makedsn() method to support connecting to a sharded database (new in Oracle Database 12.2). <br></div><div><div><br></div><div>- Removed requirement that encoding and nencoding both be specified when creating a connection or session pool. The missing value is set to its default value if one of the values is set and the other is not (<a class="gmail-m_-9077529093058346402m_-7827412571390462889gmail-moz-txt-link-freetext" href="https://github.com/oracle/python-cx_Oracle/issues/36" target="_blank">https://github.com/oracle/pyt<wbr>hon-cx_Oracle/issues/36</a>). </div><div><br></div><div><div> - Permit use of both string and unicode for Python 2.7 for creating session pools and for changing passwords (<a class="gmail-m_-9077529093058346402m_-7827412571390462889gmail-moz-txt-link-freetext" href="https://github.com/oracle/python-cx_Oracle/issues/23" target="_blank">https://github.com/oracle/pyt<wbr>hon-cx_Oracle/issues/23</a>). <br></div></div><div><br></div></div><div><b><u>Data Type and Data Handling Enhancements</u></b></div><div><br></div><div>- Added attributes Variable.actualElements and Variable.values to variables. <br></div><div>
<br>- Added support for smallint and float data types in Oracle objects, as 
requested (<a class="gmail-m_-9077529093058346402m_-7827412571390462889gmail-moz-txt-link-freetext" href="https://github.com/oracle/python-cx_Oracle/issues/4" target="_blank">https://github.com/oracle/pyt<wbr>hon-cx_Oracle/issues/4</a>).</div><div><br></div><div>- Added 
support for getting/setting attributes of objects or element values in 
collections that contain LOBs, BINARY_FLOAT values, BINARY_DOUBLE values 
and NCHAR and NVARCHAR2 values. The error message for any types that are 
not supported has been improved as well.<br><br>- An exception is no longer raised when a collection is empty for 
methods Object.first() and Object.last(). Instead, the value None is 
returned to be consistent with the methods Object.next() and Object.prev().
<br>
<br>- Removed requirement for specifying a maximum size when fetching LONG 
or LONG raw columns. This also allows CLOB, NCLOB, BLOB and BFILE 
columns to be fetched as strings or bytes without needing to specify a 
maximum size. The method Cursor.setoutputsize no longer does anything, 
since ODPI-C automatically manages buffer sizes of LONG and LONG RAW 
columns.
<br><br>- Enable temporary LOB caching in order to avoid disk I/O as suggested 
(<a class="gmail-m_-9077529093058346402m_-7827412571390462889gmail-moz-txt-link-freetext" href="https://github.com/oracle/odpi/issues/10" target="_blank">https://github.com/oracle/odp<wbr>i/issues/10</a>).
<br><br></div><div><b><u>Error Handling Enhancements</u></b></div><div><br></div><div>- Provide improved error message when OCI environment cannot be created, 
such as when the oraaccess.xml file cannot be processed properly.
<br>
<br>- Define exception classes on the connection object in addition to at 
module scope in order to simplify error handling in multi-connection 
environments, as specified in the Python DB API.
<br><br></div><div><b><u>Test Enhancements</u></b><br></div><div>
<br>- Reworked test suite and samples so that they are independent of each 
other and so that the SQL scripts used to create/drop schemas are easily 
adjusted to use different schema names, if desired. </div><div><br></div><div> - Updated DB API test suite stub to support Python 3. <br>
<br><b><u>Removals</u></b><br>
<br>- Dropped deprecated parameter twophase from the cx_Oracle.connect 
method. Applications should set the Connection.internal_name and 
Connection.external_name attributes instead to a value appropriate to 
the application.
<br>
<br>- Dropped deprecated parameters action, module and clientinfo from the 
cx_Oracle.connect method. The appcontext parameter should be used instead.
<br>
<br>- Dropped deprecated attribute numbersAsString from cursor objects. Use 
an output type handler instead.
<br>
<br>- Dropped deprecated attributes cqqos and rowids from subscription 
objects. Use the qos attribute instead.
<br>
<br>- Dropped deprecated parameters cqqos and rowids from the 
Connection.subscribe() method. Use the qos parameter instead.
<br>
<br></div></div>