Skip to content

Commit 4ed562c

Browse files
Documentation updates, including changes for PEP 8 compliance, to take
into account the fact that the default branch has changed to main, etc.
1 parent 97be497 commit 4ed562c

33 files changed

+742
-575
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ See [/test][11].
3939

4040
## Contributing
4141

42-
See [CONTRIBUTING](https://github.com/oracle/python-cx_Oracle/blob/master/CONTRIBUTING.md)
42+
See [CONTRIBUTING](https://github.com/oracle/python-cx_Oracle/blob/main/CONTRIBUTING.md)
4343

4444
## License
4545

4646
cx_Oracle is licensed under a BSD license which you can find [here][3].
4747

4848
[1]: https://www.python.org/dev/peps/pep-0249
4949
[2]: http://cx-oracle.readthedocs.io
50-
[3]: https://github.com/oracle/python-cx_Oracle/blob/master/LICENSE.txt
50+
[3]: https://github.com/oracle/python-cx_Oracle/blob/main/LICENSE.txt
5151
[5]: http://lists.sourceforge.net/lists/listinfo/cx-oracle-users
52-
[6]: https://github.com/oracle/python-cx_Oracle/tree/master/samples/tutorial
52+
[6]: https://github.com/oracle/python-cx_Oracle/tree/main/samples/tutorial
5353
[7]: http://cx-oracletools.sourceforge.net
5454
[8]: http://cx-pyoraclelib.sourceforge.net
5555
[9]: https://github.com/oracle/python-cx_Oracle/issues
56-
[11]: https://github.com/oracle/python-cx_Oracle/tree/master/test
57-
[12]: https://github.com/oracle/python-cx_Oracle/tree/master/samples
56+
[11]: https://github.com/oracle/python-cx_Oracle/tree/main/test
57+
[12]: https://github.com/oracle/python-cx_Oracle/tree/main/samples
5858
[14]: https://cx-oracle.readthedocs.io/en/latest/release_notes.html
5959
[15]: https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html

doc/src/api_manual/connection.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,18 @@ Connection Object
7474
that a single round-trip to the database may take before a timeout will
7575
occur. A value of 0 means that no timeout will take place.
7676

77+
If a timeout occurs, the error *DPI-1067* will be returned if the
78+
connection is still usable. Alternatively the error *DPI-1080* will be
79+
returned if the connection has become invalid and can no longer be used.
80+
7781
.. versionadded:: 7.0
7882

7983
.. versionchanged:: 8.2
8084

8185
For consistency and compliance with the PEP 8 naming style, the
8286
attribute `callTimeout` was renamed to `call_timeout`. The old name
83-
will continue to work for a period of time.
87+
will continue to work for a period of time. The error *DPI-1080* was
88+
also introduced in this release.
8489

8590
.. note::
8691

doc/src/api_manual/cursor.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Cursor Object
6767
Array variables can only be used for PL/SQL associative arrays with
6868
contiguous keys. For PL/SQL associative arrays with sparsely populated keys
6969
or for varrays and nested tables, the approach shown in this
70-
`example <https://github.com/oracle/python-cx_Oracle/blob/master/
70+
`example <https://github.com/oracle/python-cx_Oracle/blob/main/
7171
samples/plsql_collection.py>`__ needs to be used.
7272

7373
.. note::

doc/src/api_manual/deprecations.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if applicable. The most recent deprecations are listed first.
3535
* - Positional parameters to :meth:`cx_Oracle.connect()`
3636
- Replace with keyword parameters in order to comply with the Python
3737
database API.
38-
* - positional parameters to :meth:`cx_Oracle.SessionPool()`
38+
* - Positional parameters to :meth:`cx_Oracle.SessionPool()`
3939
- Replace with keyword parameters in order to comply with the Python
4040
database API.
4141
* - `threaded` parameter to :meth:`cx_Oracle.SessionPool()`

doc/src/api_manual/module.rst

+9-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Module Interface
9797
See the :ref:`globalization <globalization>` section for details on the
9898
encoding and nencoding parameters. Note the default encoding and nencoding
9999
values changed to "UTF-8" in cx_Oracle 8, and any character set in NLS_LANG
100-
is ignored.
100+
is ignored. In a future release of cx_Oracle, only UTF-8 will be supported.
101101

102102
The edition parameter is expected to be a string if specified and sets the
103103
edition to use for the session. It is only relevant if both the client and
@@ -208,7 +208,7 @@ Module Interface
208208

209209

210210
.. function:: SessionPool(user=None, password=None, dsn=None, min=1, max=2, \
211-
increment=1, connectiontype=cx_Oracle.Connection, threaded=False, \
211+
increment=1, connectiontype=cx_Oracle.Connection, threaded=True, \
212212
getmode=cx_Oracle.SPOOL_ATTRVAL_NOWAIT, events=False, \
213213
homogeneous=True, externalauth=False, encoding=None, nencoding=None, \
214214
edition=None, timeout=0, wait_timeout=0, max_lifetime_session=0, \
@@ -275,7 +275,8 @@ Module Interface
275275
values transferred between cx_Oracle and Oracle Database, see
276276
:ref:`Character Sets and Globalization <globalization>`. Note the default
277277
encoding and nencoding values changed to "UTF-8" in cx_Oracle 8, and any
278-
character set in NLS_LANG is ignored.
278+
character set in NLS_LANG is ignored. In a future release of cx_Oracle,
279+
only UTF-8 will be supported.
279280

280281
The edition parameter is expected to be a string, if specified, and sets the
281282
edition to use for the sessions in the pool. It is only relevant if both the
@@ -285,7 +286,9 @@ Module Interface
285286
The timeout parameter is expected to be an integer, if specified, and sets
286287
the length of time (in seconds) after which idle sessions in the pool are
287288
terminated. Note that termination only occurs when the pool is accessed.
288-
The default value of 0 means that no idle sessions are terminated.
289+
The default value of 0 means that no idle sessions are terminated. The
290+
initial pool timeout must be non-zero if you subsequently want to change
291+
the timeout with :meth:`SessionPool.reconfigure()`.
289292

290293
The wait_timeout parameter is expected to be an integer, if specified, and
291294
sets the length of time (in milliseconds) that the caller should wait for
@@ -350,7 +353,8 @@ Module Interface
350353
`session_callback` and the parameter `maxSessionsPerShard` was renamed
351354
to `max_sessions_per_shard`. The old names will continue to work as
352355
keyword parameters for a period of time. The `threaded` parameter value
353-
is ignored and threading is always enabled.
356+
is ignored and threading is always enabled; in previous versions the
357+
default was False.
354358

355359

356360
.. function:: Time(hour, minute, second)

doc/src/api_manual/session_pool.rst

+19-5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ SessionPool Object
7171
connection has been established.
7272

7373

74+
.. attribute:: SessionPool.getmode
75+
76+
This read-write attribute determines how connections are returned from the
77+
pool. If :data:`~cx_Oracle.SPOOL_ATTRVAL_FORCEGET` is specified, a new
78+
connection will be returned even if there are no free sessions in the pool.
79+
:data:`~cx_Oracle.SPOOL_ATTRVAL_NOWAIT` will raise an exception if there
80+
are no free sessions are available in the pool. If
81+
:data:`~cx_Oracle.SPOOL_ATTRVAL_WAIT` is specified and there are no free
82+
sessions in the pool, the caller will wait until a free session is
83+
available. :data:`~cx_Oracle.SPOOL_ATTRVAL_TIMEDWAIT` uses the value of
84+
:data:`~SessionPool.wait_timeout` to determine how long the caller should
85+
wait for a session to become available before returning an error.
86+
87+
7488
.. attribute:: SessionPool.homogeneous
7589

7690
This read-write boolean attribute indicates whether the pool is considered
@@ -128,11 +142,11 @@ SessionPool Object
128142
This read-write integer attribute specifies the pool ping interval in
129143
seconds. When a connection is acquired from the pool, a check is first made
130144
to see how long it has been since the connection was put into the pool. If
131-
this idle time exceeds ``ping_interval``, then a :ref:`round-trip <roundtrips>`
132-
ping to the database is performed. If the connection is unusable, it is
133-
discarded and a different connection is selected to be returned by
134-
:meth:`SessionPool.acquire()`. Setting ``ping_interval`` to a negative
135-
value disables pinging. Setting it to 0 forces a ping for every
145+
this idle time exceeds ``ping_interval``, then a :ref:`round-trip
146+
<roundtrips>` ping to the database is performed. If the connection is
147+
unusable, it is discarded and a different connection is selected to be
148+
returned by :meth:`SessionPool.acquire()`. Setting ``ping_interval`` to a
149+
negative value disables pinging. Setting it to 0 forces a ping for every
136150
``aquire()`` and is not recommended.
137151

138152
Prior to cx_Oracle 8.2, the ping interval was fixed at 60 seconds.

doc/src/api_manual/soda.rst

+19-11
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,11 @@ SODA Collection Object
256256

257257
The hint parameter, if specified, supplies a hint to the database when
258258
processing the SODA operation. This is expected to be a string in the same
259-
format as SQL hints but without the enclosing comment characters. Use of
260-
this parameter requires Oracle Client 21.3 or higher (or Oracle Client 19
261-
from 19.11).
259+
format as SQL hints but without any comment characters, for example
260+
``hint="MONITOR"``. While you could use this to pass any SQL hint, the
261+
hints ``MONITOR`` (turn on monitoring) and ``NO_MONITOR`` (turn off
262+
monitoring) are the most useful. Use of the hint parameter requires Oracle
263+
Client 21.3 or higher (or Oracle Client 19 from 19.11).
262264

263265
.. note::
264266

@@ -288,9 +290,11 @@ SODA Collection Object
288290

289291
The hint parameter, if specified, supplies a hint to the database when
290292
processing the SODA operation. This is expected to be a string in the same
291-
format as SQL hints but without the enclosing comment characters. Use of
292-
this parameter requires Oracle Client 21.3 or higher (or Oracle Client 19
293-
from 19.11).
293+
format as SQL hints but without any comment characters, for example
294+
``hint="MONITOR"``. While you could use this to pass any SQL hint, the
295+
hints ``MONITOR`` (turn on monitoring) and ``NO_MONITOR`` (turn off
296+
monitoring) are the most useful. Use of the hint parameter requires Oracle
297+
Client 21.3 or higher (or Oracle Client 19 from 19.11).
294298

295299
.. versionadded:: 7.0
296300

@@ -339,9 +343,11 @@ SODA Collection Object
339343

340344
The hint parameter, if specified, supplies a hint to the database when
341345
processing the SODA operation. This is expected to be a string in the same
342-
format as SQL hints but without the enclosing comment characters. Use of
343-
this parameter requires Oracle Client 21.3 or higher (or Oracle Client 19
344-
from 19.11).
346+
format as SQL hints but without any comment characters, for example
347+
``hint="MONITOR"``. While you could use this to pass any SQL hint, the
348+
hints ``MONITOR`` (turn on monitoring) and ``NO_MONITOR`` (turn off
349+
monitoring) are the most useful. Use of the hint parameter requires Oracle
350+
Client 21.3 or higher (or Oracle Client 19 from 19.11).
345351

346352
This method requires Oracle Client 19.9 or higher in addition to the usual
347353
SODA requirements.
@@ -560,8 +566,10 @@ SODA Operation Object
560566

561567
Specifies a hint that will be provided to the SODA operation when it is
562568
performed. This is expected to be a string in the same format as SQL hints
563-
but without the enclosing comment characters. Use of this method
564-
requires Oracle Client 21.3 or higher (or Oracle Client 19 from 19.11).
569+
but without any comment characters. While you could use this to pass any SQL
570+
hint, the hints ``MONITOR`` (turn on monitoring) and ``NO_MONITOR`` (turn
571+
off monitoring) are the most useful. Use of this method requires Oracle
572+
Client 21.3 or higher (or Oracle Client 19 from 19.11).
565573

566574
As a convenience, the SodaOperation object is returned so that further
567575
criteria can be specified by chaining methods together.

doc/src/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
# The suffix of source filenames.
2929
source_suffix = '.rst'
3030

31-
# The master toctree document.
32-
master_doc = 'index'
31+
# The main toctree document.
32+
main_doc = 'index'
3333

3434
# General substitutions.
3535
project = 'cx_Oracle'

doc/src/release_notes.rst

+32-20
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,16 @@
55
cx_Oracle Release Notes
66
=======================
77

8+
For any deprecations, see :ref:`Deprecations <deprecations>`.
9+
810
Version 8.2 (TBD)
911
-----------------
1012

1113
#) Updated embedded ODPI-C to `version 4.2.0
1214
<https://oracle.github.io/odpi/doc/releasenotes.html#
1315
version-4-2-tbd>`__.
14-
#) Added :ref:`SODA metadata cache <sodametadatacache>` support to connection
15-
pools. This significantly improves the performance of methods
16-
:meth:`SodaDatabase.createCollection()` (when not specifying a value for
17-
the metadata parameter) and :meth:`SodaDatabase.openCollection()`. Caching
18-
is available when using Oracle Client version 19.11 and higher.
19-
#) Added support for supplying hints to SODA operations. A new non-terminal
20-
method :meth:`~SodaOperation.hint()` was added and a `hint` parameter was
21-
added to the methods :meth:`SodaCollection.insertOneAndGet()`,
22-
:meth:`SodaCollection.insertManyAndGet()` and
23-
:meth:`SodaCollection.saveAndGet()`. All of these require Oracle Client
24-
21.3 or higher (or Oracle Client 19 from 19.11).
16+
#) Threaded mode is now always enabled when creating connection pools with
17+
:meth:`cx_Oracle.SessionPool()`. Any `threaded` parameter value is ignored.
2518
#) Added parameter `stmtcachesize` to :meth:`cx_Oracle.connect()` and
2619
:meth:`cx_Oracle.SessionPool()` in order to permit specifying the size of
2720
the statement cache during the creation of pools and standalone
@@ -31,20 +24,39 @@ Version 8.2 (TBD)
3124
attribute :data:`SessionPool.ping_interval` was added in order to permit
3225
making adjustments after the pool has been created. In previous cx_Oracle
3326
releases a fixed ping interval of 60 seconds was used.
27+
#) Added parameter `soda_metadata_cache` to :meth:`cx_Oracle.SessionPool()` for
28+
:ref:`SODA metadata cache <sodametadatacache>` support. In addition, the
29+
attribute :data:`SessionPool.soda_metadata_cache` was added in order to
30+
permit making adjustments after the pool has been created. This feature
31+
significantly improves the performance of methods
32+
:meth:`SodaDatabase.createCollection()` (when not specifying a value for the
33+
metadata parameter) and :meth:`SodaDatabase.openCollection()`. Caching is
34+
available when using Oracle Client version 19.11 and higher.
35+
#) Added support for supplying hints to SODA operations. A new non-terminal
36+
method :meth:`~SodaOperation.hint()` was added and a `hint` parameter was
37+
added to the methods :meth:`SodaCollection.insertOneAndGet()`,
38+
:meth:`SodaCollection.insertManyAndGet()` and
39+
:meth:`SodaCollection.saveAndGet()`. All of these require Oracle Client
40+
21.3 or higher (or Oracle Client 19 from 19.11).
3441
#) Added parameter `bypass_decode` to :meth:`Cursor.var()` in order to allow
3542
the `decode` step to be bypassed when converting data from Oracle Database
3643
into Python strings
3744
(`issue 385 <https://github.com/oracle/python-cx_Oracle/issues/385>`__).
3845
Initial work was done in `PR 549
3946
<https://github.com/oracle/python-cx_Oracle/pull/549>`__.
40-
#) Threaded mode is now always enabled when creating connection pools with
41-
:meth:`cx_Oracle.SessionPool()`. Any `threaded` parameter value is ignored.
47+
#) Enhanced dead connection detection. If an Oracle Database error indicates
48+
that a connection is no longer usable, the error `DPI-1080: connection was
49+
closed by ORA-%d` is now returned. The `%d` will be the Oracle error
50+
causing the connection to be closed. Using the connection after this will
51+
give `DPI-1010: not connected`. This behavior also applies for
52+
:data:`Connection.call_timeout` errors that result in an unusable
53+
connection.
4254
#) Eliminated a memory leak when calling :meth:`SodaOperation.filter()` with a
4355
dictionary.
4456
#) The distributed transaction handle assosciated with the connection is now
4557
cleared on commit or rollback (`issue 530
4658
<https://github.com/oracle/python-cx_Oracle/issues/530>`__).
47-
#) Added check to ensure that when setting variables or object attributes, the
59+
#) Added a check to ensure that when setting variables or object attributes, the
4860
type of the temporary LOB must match the expected type.
4961
#) A small number of parameter, method, and attribute names were updated to
5062
follow the PEP 8 style guide. This brings better consistency to the
@@ -1020,10 +1032,10 @@ Version 6.0 beta 1 (April 2017)
10201032
tagging.
10211033
#) Added parameter edition to the :meth:`cx_Oracle.SessionPool` method.
10221034
#) Added support for
1023-
`universal rowids <https://github.com/oracle/python-cx_Oracle/blob/master/
1035+
`universal rowids <https://github.com/oracle/python-cx_Oracle/blob/main/
10241036
samples/universal_rowids.py>`__.
10251037
#) Added support for `DML Returning of multiple rows
1026-
<https://github.com/oracle/python-cx_Oracle/blob/master/samples/
1038+
<https://github.com/oracle/python-cx_Oracle/blob/main/samples/
10271039
dml_returning_multiple_rows.py>`__.
10281040
#) Added attributes :attr:`Variable.actualElements` and
10291041
:attr:`Variable.values` to variables.
@@ -1053,19 +1065,19 @@ Version 6.0 beta 1 (April 2017)
10531065
#) Dropped deprecated parameters action, module and clientinfo from the
10541066
:meth:`cx_Oracle.connect` method. The appcontext parameter should be used
10551067
instead as shown in this `sample <https://github.com/oracle/
1056-
python-cx_Oracle/blob/master/samples/app_context.py>`__.
1068+
python-cx_Oracle/blob/main/samples/app_context.py>`__.
10571069
#) Dropped deprecated attribute numbersAsString from
10581070
:ref:`cursor objects <cursorobj>`. Use an output type handler instead as
10591071
shown in this `sample <https://github.com/oracle/python-cx_Oracle/blob/
1060-
master/samples/return_numbers_as_decimals.py>`__.
1072+
main/samples/return_numbers_as_decimals.py>`__.
10611073
#) Dropped deprecated attributes cqqos and rowids from
10621074
:ref:`subscription objects <subscrobj>`. Use the qos attribute instead as
10631075
shown in this `sample <https://github.com/oracle/python-cx_Oracle/blob/
1064-
master/samples/cqn.py>`__.
1076+
main/samples/cqn.py>`__.
10651077
#) Dropped deprecated parameters cqqos and rowids from the
10661078
:meth:`Connection.subscribe()` method. Use the qos parameter instead as
10671079
shown in this `sample <https://github.com/oracle/python-cx_Oracle/blob/
1068-
master/samples/cqn.py>`__.
1080+
main/samples/cqn.py>`__.
10691081

10701082

10711083
Version 5.3 (March 2017)

0 commit comments

Comments
 (0)