Skip to content

Commit 6f7fd0b

Browse files
Check if server supports OOB check at connect (#419).
1 parent cb110f9 commit 6f7fd0b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

doc/src/release_notes.rst

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Thin Mode Changes
2121
:data:`oracledb.DB_TYPE_LONG` or :data:`oracledb.DB_TYPE_LONG_RAW` to
2222
to a different compatible type
2323
(`issue 424 <https://github.com/oracle/python-oracledb/issues/424>`__).
24+
#) If the database states that an out-of-band break check should not take
25+
place during connect (by setting the `DISABLE_OOB_AUTO
26+
<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&
27+
id=GUID-490A0B3B-FEF3-425A-81B0-6FA29D4B8C0E>`__ parameter to TRUE),
28+
python-oracledb no longer attempts to do so
29+
(`issue 419 <https://github.com/oracle/python-oracledb/issues/419>`__).
2430
#) All exceptions subclassed from ``OSError`` now cause connection retry
2531
attempts, subject to the connection ``retry_count`` and ``retry_delay``
2632
parameters

src/oracledb/impl/thin/capabilities.pyx

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ cdef class Capabilities:
4141
uint32_t max_string_size
4242
bint supports_fast_auth
4343
bint supports_oob
44+
bint supports_oob_check
4445
bint supports_end_of_response
4546
bint supports_pipelining
4647
uint32_t sdu
@@ -60,6 +61,8 @@ cdef class Capabilities:
6061
self.supports_oob = protocol_options & TNS_GSO_CAN_RECV_ATTENTION
6162
if flags & TNS_ACCEPT_FLAG_FAST_AUTH:
6263
self.supports_fast_auth = True
64+
if flags & TNS_ACCEPT_FLAG_CHECK_OOB:
65+
self.supports_oob_check = True
6366
if protocol_version >= TNS_VERSION_MIN_END_OF_RESPONSE:
6467
if flags & TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE:
6568
self.compile_caps[TNS_CCAP_TTC4] |= TNS_CCAP_END_OF_RESPONSE

src/oracledb/impl/thin/constants.pxi

+1
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ cdef enum:
762762

763763
# accept flags
764764
cdef enum:
765+
TNS_ACCEPT_FLAG_CHECK_OOB = 0x00000001
765766
TNS_ACCEPT_FLAG_FAST_AUTH = 0x10000000
766767
TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE = 0x02000000
767768

src/oracledb/impl/thin/protocol.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ cdef class Protocol(BaseProtocol):
291291

292292
# if we can use OOB, send an urgent message now followed by a reset
293293
# marker to see if the server understands it
294-
if self._caps.supports_oob \
295-
and self._caps.protocol_version >= TNS_VERSION_MIN_OOB_CHECK:
294+
if self._caps.supports_oob and self._caps.supports_oob_check:
296295
self._transport.send_oob_break()
297296
self._send_marker(self._write_buf, TNS_MARKER_TYPE_RESET)
298297

0 commit comments

Comments
 (0)