Skip to content

Commit e65a2d4

Browse files
Doc updates.
1 parent e3ab091 commit e65a2d4

File tree

14 files changed

+657
-555
lines changed

14 files changed

+657
-555
lines changed

doc/src/api_manual/connect_param.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ConnectParams Attributes
185185

186186
This read-only attribute is a string that specifies the name of the proxy user to connect to.
187187
If this value is not specified, then it will be parsed out of the user if the user attribute
188-
is in the form "user{proxy_user]".
188+
is in the form "user[proxy_user]".
189189

190190
This attribute is supported in the python-oracledb Thin and Thick modes.
191191

doc/src/api_manual/connection_pool.rst

Lines changed: 61 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,28 @@ ConnectionPool Methods
5555
``password`` parameters cannot be specified. If they are, an exception will
5656
be raised.
5757

58-
The ``cclass`` parameter, if specified, should be a string corresponding to the
59-
connection class for database resident connection pooling (DRCP).
58+
The ``cclass`` parameter, if specified, should be a string corresponding to
59+
the connection class for database resident connection pooling (DRCP).
6060

6161
The ``purity`` parameter is expected to be one of
6262
:data:`~oracledb.PURITY_NEW`, :data:`~oracledb.PURITY_ANY`, or
6363
:data:`~oracledb.PURITY_DEFAULT`.
6464

65-
The ``tag`` parameter, if specified, is expected to be a string with name=value
66-
pairs like "k1=v1;k2=v2" and will limit the connections that can be returned
67-
from a connection pool unless the ``matchanytag`` parameter is set to True. In
68-
that case, connections with the specified tag will be preferred over others,
69-
but if no such connections are available, then a connection with a different tag
70-
may be returned instead. In any case, untagged connections will always be returned
71-
if no connections with the specified tag are available. Connections are tagged when
72-
they are :meth:`released <ConnectionPool.release>` back to the pool.
65+
The ``tag`` parameter, if specified, is expected to be a string with
66+
name=value pairs like "k1=v1;k2=v2" and will limit the connections that can
67+
be returned from a connection pool unless the ``matchanytag`` parameter is
68+
set to True. In that case, connections with the specified tag will be
69+
preferred over others, but if no such connections are available, then a
70+
connection with a different tag may be returned instead. In any case,
71+
untagged connections will always be returned if no connections with the
72+
specified tag are available. Connections are tagged when they are
73+
:meth:`released <ConnectionPool.release>` back to the pool.
74+
75+
The ``shardingkey`` and ``supershardingkey`` parameters, if specified, are
76+
expected to be a sequence of values which will be used to identify the
77+
database shard to connect to. The key values can be strings, numbers, bytes
78+
or dates.
7379

74-
The ``shardingkey`` and ``supershardingkey`` parameters, if specified, are expected
75-
to be a sequence of values which will be used to identify the database
76-
shard to connect to. The key values can be strings, numbers, bytes or
77-
dates.
7880

7981
.. method:: ConnectionPool.close(force=False)
8082

@@ -84,47 +86,15 @@ ConnectionPool Methods
8486
If any connections have been acquired and not released back to the pool,
8587
this method will fail unless the ``force`` parameter is set to True.
8688

87-
.. method:: ConnectionPool.create_pool(dsn, pool_class, pool_params, conn_params, \
88-
min, max, increment, connectiontype, getmode, homogeneous, externalauth,timeout, \
89-
wait_timeout, max_lifetime_session, session_callback, max_sessions_per_shard, \
90-
soda_metadata_cache, ping_interval, user, proxy_user, password, newpassword, \
91-
wallet_password, host, port, protocol, https_proxy, https_proxy_port, service_name, \
92-
sid, server_type, cclass, purity, expire_time, retry_count, retry_delay, \
93-
tcp_connect_timeout, ssl_server_dn_match, ssl_server_cert_dn, wallet_location, \
94-
events, mode, disable_oob, stmtcachesize, edition, tag, matchanytag, config_dir, \
95-
appcontext, shardingkey, supershardingkey, handle)
96-
97-
Creates a connection pool with the supplied parameters and returns it.
98-
99-
The ``dsn`` parameter (data source name) can be a string in the format
100-
``user/password@connect_string`` or can simply be a connect string in
101-
which case the user and password need to be specified separately.
102-
See :ref:`connstr` for more information.
103-
104-
The ``pool_class`` parameter is a ConnectionPool or a subclass of
105-
ConnectionPool.
106-
107-
The ``pool_params`` parameter is of type PoolParams and contains
108-
parameters that are used to create the pool. If not specified, a new
109-
PoolParams object will be created using the additional keyword arguments.
110-
See :ref:`poolparam` for more information.
111-
112-
The ``conn_params`` parameter is of type ConnectParams and contains
113-
connection parameters that will be used when creating connections
114-
in the pool. If not specified, a new ConnectParams object will be created
115-
using the additional keyword arguments. See :ref:`connparam` for more information.
116-
If a dsn is supplied, it will modify the connection parameters to include the
117-
parameters supplied in the dsn.
118-
11989

12090
.. method:: ConnectionPool.drop(connection)
12191

12292
Drops the connection from the pool which is useful if the connection is no
12393
longer usable (such as when the session is killed).
12494

12595

126-
.. method:: ConnectionPool.reconfigure([min, max, increment, getmode, timeout, \
127-
wait_timeout, max_lifetime_session, max_sessions_per_shard, \
96+
.. method:: ConnectionPool.reconfigure([min, max, increment, getmode, \
97+
timeout, wait_timeout, max_lifetime_session, max_sessions_per_shard, \
12898
soda_metadata_cache, stmtcachesize, ping_interval])
12999

130100
Reconfigures various parameters of a connection pool. The pool size can be
@@ -134,8 +104,9 @@ ConnectionPool Methods
134104
:data:`~ConnectionPool.timeout`, :data:`~ConnectionPool.wait_timeout`,
135105
:data:`~ConnectionPool.max_lifetime_session`,
136106
:data:`~ConnectionPool.max_sessions_per_shard`,
137-
:data:`~ConnectionPool.soda_metadata_cache`, :data:`~ConnectionPool.stmtcachesize`
138-
and :data:`~ConnectionPool.ping_interval` attributes can be set directly or
107+
:data:`~ConnectionPool.soda_metadata_cache`,
108+
:data:`~ConnectionPool.stmtcachesize` and
109+
:data:`~ConnectionPool.ping_interval` attributes can be set directly or
139110
with ``reconfigure()``.
140111

141112
All parameters are optional. Unspecified parameters will leave those pool
@@ -149,26 +120,28 @@ ConnectionPool Methods
149120
:meth:`ConnectionPool.acquire()` depends on the ``getmode`` in effect when
150121
``acquire()`` is called:
151122

152-
* With mode :data:`~oracledb.POOL_GETMODE_FORCEGET`, an ``acquire()`` call will
153-
wait until the pool has been reconfigured.
123+
* With mode :data:`~oracledb.POOL_GETMODE_FORCEGET`, an ``acquire()`` call
124+
will wait until the pool has been reconfigured.
154125

155-
* With mode :data:`~oracledb.POOL_GETMODE_TIMEDWAIT`, an ``acquire()`` call will
156-
try to acquire a connection in the time specified by pool.wait_timeout and return
157-
an error if the time taken exceeds that value.
126+
* With mode :data:`~oracledb.POOL_GETMODE_TIMEDWAIT`, an ``acquire()`` call
127+
will try to acquire a connection in the time specified by
128+
pool.wait_timeout and return an error if the time taken exceeds that
129+
value.
158130

159-
* With mode :data:`~oracledb.POOL_GETMODE_WAIT`, an ``acquire()`` call will wait
160-
until after the pool has been reconfigured and a connection is available.
131+
* With mode :data:`~oracledb.POOL_GETMODE_WAIT`, an ``acquire()`` call will
132+
wait until after the pool has been reconfigured and a connection is
133+
available.
161134

162-
* With mode :data:`~oracledb.POOL_GETMODE_NOWAIT`, if the number of busy connections
163-
is less than the pool size, ``acquire()`` will return a new connection after pool
164-
reconfiguration is complete.
135+
* With mode :data:`~oracledb.POOL_GETMODE_NOWAIT`, if the number of busy
136+
connections is less than the pool size, ``acquire()`` will return a new
137+
connection after pool reconfiguration is complete.
165138

166139
Closing connections with :meth:`ConnectionPool.release()` or
167140
:meth:`Connection.close()` will wait until any pool size reconfiguration is
168141
complete.
169142

170-
Closing the connection pool with :meth:`ConnectionPool.close()` will wait until
171-
reconfiguration is complete.
143+
Closing the connection pool with :meth:`ConnectionPool.close()` will wait
144+
until reconfiguration is complete.
172145

173146
See :ref:`Connection Pool Reconfiguration <poolreconfiguration>`.
174147

@@ -201,7 +174,8 @@ ConnectionPool Attributes
201174

202175
.. attribute:: ConnectionPool.busy
203176

204-
This read-only attribute returns the number of connections currently acquired.
177+
This read-only attribute returns the number of connections currently
178+
acquired.
205179

206180

207181
.. attribute:: ConnectionPool.dsn
@@ -214,14 +188,14 @@ ConnectionPool Attributes
214188

215189
This read-write attribute determines how connections are returned from the
216190
pool. If :data:`~oracledb.POOL_GETMODE_FORCEGET` is specified, a new
217-
connection will be returned even if there are no free connections in the pool.
218-
:data:`~oracledb.POOL_GETMODE_NOWAIT` will raise an exception if there
219-
are no free connections are available in the pool. If
191+
connection will be returned even if there are no free connections in the
192+
pool. :data:`~oracledb.POOL_GETMODE_NOWAIT` will raise an exception if
193+
there are no free connections are available in the pool. If
220194
:data:`~oracledb.POOL_GETMODE_WAIT` is specified and there are no free
221195
connections in the pool, the caller will wait until a free connection is
222196
available. :data:`~oracledb.POOL_GETMODE_TIMEDWAIT` uses the value of
223-
:data:`~ConnectionPool.wait_timeout` to determine how long the caller should
224-
wait for a connection to become available before returning an error.
197+
:data:`~ConnectionPool.wait_timeout` to determine how long the caller
198+
should wait for a connection to become available before returning an error.
225199

226200
.. attribute:: ConnectionPool.homogeneous
227201

@@ -256,20 +230,20 @@ ConnectionPool Attributes
256230

257231
.. attribute:: ConnectionPool.max_sessions_per_shard
258232

259-
This read-write attribute returns the number of sessions that can be created
260-
per shard in the pool. Setting this attribute greater than zero specifies
261-
the maximum number of sessions in the pool that can be used for any given
262-
shard in a sharded database. This lets connections in the pool be balanced
263-
across the shards. A value of zero will not set any maximum number of
264-
sessions for each shard. This attribute is only available in Oracle Client
265-
18.3 and higher.
233+
This read-write attribute returns the number of sessions that can be
234+
created per shard in the pool. Setting this attribute greater than zero
235+
specifies the maximum number of sessions in the pool that can be used for
236+
any given shard in a sharded database. This lets connections in the pool be
237+
balanced across the shards. A value of zero will not set any maximum number
238+
of sessions for each shard. This attribute is only available in Oracle
239+
Client 18.3 and higher.
266240

267241

268242
.. attribute:: ConnectionPool.min
269243

270244
This read-only attribute returns the number of connections with which the
271-
connection pool was created and the minimum number of connections that will be
272-
controlled by the connection pool.
245+
connection pool was created and the minimum number of connections that will
246+
be controlled by the connection pool.
273247

274248

275249
.. attribute:: ConnectionPool.name
@@ -279,8 +253,8 @@ ConnectionPool Attributes
279253

280254
.. attribute:: ConnectionPool.opened
281255

282-
This read-only attribute returns the number of connections currently opened by
283-
the pool.
256+
This read-only attribute returns the number of connections currently opened
257+
by the pool.
284258

285259

286260
.. attribute:: ConnectionPool.ping_interval
@@ -291,8 +265,8 @@ ConnectionPool Attributes
291265
this idle time exceeds ``ping_interval``, then a :ref:`round-trip
292266
<roundtrips>` ping to the database is performed. If the connection is
293267
unusable, it is discarded and a different connection is selected to be
294-
returned by :meth:`ConnectionPool.acquire()`. Setting ``ping_interval`` to a
295-
negative value disables pinging. Setting it to 0 forces a ping for every
268+
returned by :meth:`ConnectionPool.acquire()`. Setting ``ping_interval`` to
269+
a negative value disables pinging. Setting it to 0 forces a ping for every
296270
:meth:`ConnectionPool.acquire()` and is not recommended.
297271

298272
Prior to cx_Oracle 8.2, the ping interval was fixed at 60 seconds.
@@ -328,10 +302,10 @@ ConnectionPool Attributes
328302
.. attribute:: ConnectionPool.timeout
329303

330304
This read-write attribute specifies the time (in seconds) after which idle
331-
connections will be terminated in order to maintain an optimum number of open
332-
connections. A value of 0 means that no idle connections are terminated. Note
333-
that in python-oracledb Thick mode with older Oracle Client Libraries, the
334-
termination only occurs when the pool is accessed.
305+
connections will be terminated in order to maintain an optimum number of
306+
open connections. A value of 0 means that no idle connections are
307+
terminated. Note that in python-oracledb Thick mode with older Oracle
308+
Client Libraries, the termination only occurs when the pool is accessed.
335309

336310
.. attribute:: ConnectionPool.tnsentry
337311

@@ -353,6 +327,6 @@ ConnectionPool Attributes
353327

354328
This read-write attribute specifies the time (in milliseconds) that the
355329
caller should wait for a connection to become available in the pool before
356-
returning with an error. This value is only used if the ``getmode`` parameter
357-
to :meth:`oracledb.create_pool()` was the value
330+
returning with an error. This value is only used if the ``getmode``
331+
parameter to :meth:`oracledb.create_pool()` was the value
358332
:data:`oracledb.POOL_GETMODE_TIMEDWAIT`.

doc/src/api_manual/cursor.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,11 @@ Cursor Attributes
462462
how many rows are returned to the application. For
463463
:meth:`~Cursor.fetchmany()` it is the default number of rows to fetch.
464464

465+
The attribute is only used for tuning row and SODA document fetches from
466+
the database. It does not affect data inserts.
467+
465468
Due to the performance benefits, the default ``Cursor.arraysize`` is 100
466-
instead of the 1 that the DB API recommends. This value means that 100 rows
467-
are fetched by each internal call to the database.
469+
instead of the 1 that the Python DB API recommends.
468470

469471
See :ref:`Tuning Fetch Performance <tuningfetch>` for more information.
470472

@@ -556,6 +558,9 @@ Cursor Attributes
556558
to fetch rows but at the cost of additional memory. Setting this value to 0
557559
can be useful when the timing of fetches must be explicitly controlled.
558560

561+
The attribute is only used for tuning row fetches from the database. It
562+
does not affect data inserts.
563+
559564
See :ref:`Tuning Fetch Performance <tuningfetch>` for more information.
560565

561566
.. note::

doc/src/api_manual/defaults.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Defaults Attributes
2323
.. attribute:: defaults.arraysize
2424

2525
The default value for :attr:`Cursor.arraysize`. This is a query tuning
26-
attribute, see :ref:`tuning`.
26+
attribute, see :ref:`Tuning Fetch Performance <tuningfetch>`.
2727

2828
This attribute has an initial value of 100.
2929

@@ -72,8 +72,8 @@ Defaults Attributes
7272

7373
.. attribute:: defaults.prefetchrows
7474

75-
The default value for :attr:`Cursor.prefetchrow`. This is a query tuning
76-
attribute, see :ref:`tuning`.
75+
The default value for :attr:`Cursor.prefetchrows`. This is a query tuning
76+
attribute, see :ref:`Tuning Fetch Performance <tuningfetch>`.
7777

7878
This attribute has an initial value of 2.
7979

0 commit comments

Comments
 (0)