19. Deprecations
The following tables contain all of the deprecations in the python-oracledb API, when they were first deprecated and a comment on what should be used instead, if applicable. The most recent deprecations are listed first.
Name |
Comments |
---|---|
|
VARCHAR2 and LOB columns created with the |
Parameters |
The driver encodings are always UTF-8. Remove uses of |
Parameter |
Threading is always used. Remove uses of |
Parameter |
Replace with parameter |
Parameter |
Replace with parameter |
Parameter |
Replace with parameter |
Parameter |
Replace with parameter |
Attribute |
The driver encodings are always UTF-8 so this attribute can be replaced by the constant value 4 |
|
Replace with |
|
Replace with |
Name |
Comments |
---|---|
Calling |
Call |
Setting an attribute of type |
Call |
Name |
Comments |
---|---|
Output type handler with arguments
|
Replace with |
Name |
Comments |
---|---|
SessionPool class and use of cx_Oracle.SessionPool(). |
Replace by the equivalent ConnectionPool Class. Use the new method |
Replace by the new Using Two-Phase Commits (TPC) functionality. |
|
Replace by the new Using Two-Phase Commits (TPC) functionality. |
|
Parameters |
The encodings in use are always UTF-8. |
Parameter |
This was used to allow the Oracle Client libraries to support threaded applications. This value is ignored in python-oracledb because the threaded OCI is always enabled in the Thick mode, and the option is not relevant to the Thin mode. The equivalent parameter was already deprecated for cx_Oracle.SessionPool() in cx_Oracle 8.2. |
Attribute |
This was previously deprecated. In python-oracledb 1.0 it will return a constant value of 4 since encodings are always UTF-8. |
Size argument, |
Rename the parameter to |
Pass the connection string components as connection creation, or pool creation, parameters. Or use a ConnectParams Class object. |
|
oracledb.Connection() |
This method is no longer recommended for creating connections. Use the equivalent function |
Attribute |
Remove this attribute since it is no longer needed. |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Constant |
Replace by |
Class name ObjectType |
Replace by the equivalent DbObjectType. |
Class name Object |
Replace by the equivalent DbObject. |
Many of the usages deprecated in cx_Oracle (see tables below) are still supported by python-oracledb to ease upgrade from cx_Oracle. However, these previous cx_Oracle deprecation announcements remain in force for python-oracledb. The relevant functionality may be removed in a future version of python-oracledb.
Some of the previous deprecations that have been removed and are not available in python-oracledb are listed below:
The previously deprecated function Cursor.fetchraw() has been removed in python-oracledb. Use one of the other fetch methods such as
Cursor.fetchmany()
instead.The previously deprecated function Cursor.executemanyprepared() has been removed in python-oracledb. Use
Cursor.executemany()
instead.The previously deprecated function Cursor.rowcount() has been removed in python-oracledb. Use
Cursor.executemany()
instead.The previously deprecated Advanced Queuing (AQ) API has been removed in python-oracledb. Use the new AQ API instead. AQ is only available in the python-oracledb Thick mode.
Replace Connection.deq() with
Queue.deqone()
orQueue.deqmany()
.Replace Connection.deqoptions() with
Queue.deqoptions()
.Replace Connection.enq() with
Queue.enqone()
orQueue.enqmany()
.Replace Connection.enqoptions() with
Queue.enqoptions()
.
Name |
Comments |
---|---|
|
No longer needed as the use of encodings other than UTF-8 is deprecated. Encoding is handled internally between python-oracledb and Oracle Database. |
|
No longer needed as the use of encodings other than UTF-8 is deprecated. |
|
No longer needed as the use of encodings other than UTF-8 is deprecated. |
|
No longer needed as the use of encodings other than UTF-8 is deprecated. |
Connection.maxBytesPerCharacter |
No longer needed as the use of encodings other than UTF-8 is deprecated. The constant value 4 can be used instead. |
Positional parameters to cx_Oracle.connect() |
Replace with keyword parameters in order to comply with the Python database API. |
Positional parameters to cx_Oracle.SessionPool() |
Replace with keyword parameters in order to comply with the Python database API. |
|
The value of this parameter is ignored. Threading is now always used. |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with Connection.call_timeout |
|
Replace with |
keywordParameters parameter to Cursor.callfunc() |
Replace with parameter name |
|
Replace with parameter name |
|
Replace with parameter name |
|
Replace with Cursor.fetchmany() |
|
Replace with parameter name |
|
Replace with Queue.deqmany() |
|
Replace with Queue.deqone() |
|
Replace with Queue.enqmany() |
|
Replace with Queue.enqone() |
|
Replace with Queue.deqoptions |
|
Replace with Queue.enqoptions |
|
Replace with Queue.payload_type |
|
Replace with Subscription.ip_address |
|
Replace with Message.consumer_name |
|
Replace with Message.queue_name |
|
Replace with Variable.actual_elements |
|
Replace with Variable.buffer_size |
|
Replace with Variable.num_elements |
Name |
Comments |
---|---|
|
Replace with cx_Oracle.DB_TYPE_BFILE |
|
Replace with cx_Oracle.DB_TYPE_BLOB |
|
Replace with cx_Oracle.DB_TYPE_BOOLEAN |
|
Replace with cx_Oracle.DB_TYPE_CLOB |
|
Replace with cx_Oracle.DB_TYPE_CURSOR |
|
Replace with cx_Oracle.DB_TYPE_CHAR |
|
Replace with cx_Oracle.DB_TYPE_NCHAR |
|
Replace with cx_Oracle.DB_TYPE_INTERVAL_DS |
|
Replace with cx_Oracle.DB_TYPE_LONG_RAW |
|
Replace with cx_Oracle.DB_TYPE_LONG |
|
Replace with cx_Oracle.DB_TYPE_BINARY_DOUBLE |
|
Replace with cx_Oracle.DB_TYPE_BINARY_INTEGER |
|
Replace with cx_Oracle.DB_TYPE_NVARCHAR |
|
Replace with cx_Oracle.DB_TYPE_NCLOB |
|
Replace with cx_Oracle.DB_TYPE_OBJECT |
|
Replace with cx_Oracle.DB_TYPE_TIMESTAMP |
Name |
Comments |
---|---|
|
Replace with Queue.deqone() or Queue.deqmany(). |
|
Replace with attribute Queue.deqoptions. |
|
Replace with Queue.enqone() or Queue.enqmany(). |
|
Replace with attribute Queue.enqoptions. |
Name |
Comments |
---|---|
|
Replace with ~Cursor.executemany() with None for the statement argument and an integer for the parameters argument. |