@@ -29,14 +29,31 @@ Defaults Attributes
2929
3030.. attribute :: defaults.config_dir
3131
32- The directory in which optional configuration files such as
33- ``tnsnames.ora `` will be read in python-oracledb Thin mode. This attribute
34- takes its initial value from the environment variable ``TNS_ADMIN ``.
32+ The directory in which the optional configuration file ``tnsnames.ora ``
33+ will be read in python-oracledb Thin mode.
3534
36- This attribute is not used by the python-oracledb Thick mode: the usual
37- Oracle Client search path behavior for configuration files is followed, see
35+ At time of ``import oracledb `` the value of
36+ ``oracledb.defaults.config_dir `` will be set to (first one wins):
37+
38+ - the value of ``$TNS_ADMIN ``, if ``TNS_ADMIN `` is set.
39+
40+ - ``$ORACLE_HOME/network/admin ``, if ``$ORACLE_HOME `` is set.
41+
42+ Otherwise, ``oracledb.defaults.config_dir `` will not be set.
43+
44+ This attribute is used in python-oracledb Thin mode. It is also used in
45+ Thick mode if :attr: `defaults.thick_mode_dsn_passthrough ` is *False *, see
3846 :ref: `optnetfiles `.
3947
48+ .. versionchanged :: 3.0.0
49+
50+ The directory ``$ORACLE_HOME/network/admin `` was added to the
51+ heuristic.
52+
53+ At completion of a call to :meth: `oracledb.init_oracle_client() ` in
54+ Thick mode, the value of :attr: `defaults.config_dir ` may get changed
55+ by python-oracledb.
56+
4057.. attribute :: defaults.driver_name
4158
4259 The default value that represents the driver used by the client to connect
@@ -169,27 +186,49 @@ Defaults Attributes
169186
170187.. attribute :: defaults.thick_mode_dsn_passthrough
171188
172- The default value that determines whether :ref: `connection strings
173- <connstr>` passed to :meth: `oracledb.connect() ` and
174- :meth: `oracledb.create_pool() ` in python-oracledb Thick mode will be parsed
175- by Oracle Client libraries or by python-oracledb itself.
176-
177- When the value of this attribute is *True *, then connection strings passed
178- to these methods will be sent unchanged to the Oracle Client libraries.
179-
180- Setting this attribute to *False * makes Thick and Thin mode applications
181- behave similarly regarding connection string parameter handling and
182- locating any optional :ref: `tnsnames.ora files <optnetfiles >` configuration
183- file, see :ref: `usingconfigfiles `. Connection strings used in connection
184- and pool creation methods in Thick mode are parsed by python-oracledb
185- itself and a generated connect descriptor is sent to the Oracle Client
186- libraries. The location of any optional :ref: `tnsnames.ora file
187- <optnetfiles>` used to resolve a :ref: `TNS Alias <netservice >` is
188- determined by python-oracledb heuristics instead of by the Oracle Client
189- libraries.
189+ The value that determines whether :ref: `connection strings <connstr >`
190+ passed as the ``dsn `` parameter to :meth: `oracledb.connect() `,
191+ :meth: `oracledb.create_pool() `, :meth: `oracledb.connect_async() `, and
192+ :meth: `oracledb.create_pool_async() ` in python-oracledb Thick mode will be
193+ parsed by Oracle Client libraries or by python-oracledb itself.
194+
195+ When ``thick_mode_dsn_passthrough `` is the default value `True `, the
196+ behavior of python-oracledb 2.5 and earlier versions occurs: Thick mode
197+ passes connect strings unchanged to the Oracle Client libraries to
198+ handle. Those libraries have their own heuristics for locating the optional
199+ :ref: `tnsnames.ora <optnetfiles >`, if used.
200+
201+ When ``thick_mode_dsn_passthrough `` is `False `, python-oracledb Thick mode
202+ behaves similarly to Thin mode, which can be helpful for applications that
203+ may be run in either mode:
204+
205+ - The search path used to locate and read any optional :ref: `tnsnames.ora
206+ <optnetfiles>` file is handled in the python-oracledb driver. Different
207+ :ref: `tnsnames.ora <optnetfiles >` files can be used by each
208+ connection. Note loading of optional Thick mode files such as
209+ ``sqlnet.ora `` and ``oraaccess.xml `` is always handled by Oracle Client
210+ libraries regardless of the value of ``thick_mode_dsn_passthrough ``
211+ because it is those libraries that use these files.
212+
213+ - All connect strings will be parsed by the python-oracledb driver and a
214+ generated connect descriptor is sent to the database. Parameters
215+ unrecognized by python-oracledb in :ref: `Easy Connect strings
216+ <easyconnect>` are discarded. In :ref: `full connect descriptors
217+ <conndescriptor>` passed explicitly as the ``dsn `` parameter value or
218+ stored in a :ref: `tnsnames.ora <optnetfiles >` file, any parameters that
219+ are unrecognized by python-oracledb in the ``DESCRIPTION ``,
220+ ``CONNECT_DATA `` and ``SECURITY `` sections will be passed through to the
221+ database unchanged, while unrecognized parameters in other sections are
222+ discarded.
223+
224+ - If a :ref: `Centralized Configuration Provider <configurationproviders >`
225+ is used for connection configuration, any :ref: `python-oracledb parameter
226+ values <pyoparams>` in the configuration will be used.
227+
228+ The value of ``thick_mode_dsn_passthrough `` is ignored in python-oracledb
229+ Thin mode, which always parses all connect strings (including reading a
230+ :ref: `tnsnames.ora <optnetfiles >` file, if required).
190231
191232 This attribute has an initial value of *True *.
192233
193- This attribute is ignored in python-oracledb Thin mode.
194-
195234 .. versionadded :: 3.0.0
0 commit comments