Skip to content

Commit d009ddd

Browse files
Do not send request boundaries for databases that do not support them.
1 parent 8cf2119 commit d009ddd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/oracledb/impl/thin/capabilities.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ cdef class Capabilities:
4444
bint supports_oob_check
4545
bint supports_end_of_response
4646
bint supports_pipelining
47+
bint supports_request_boundaries
4748
uint32_t sdu
4849

4950
def __init__(self):
@@ -74,13 +75,17 @@ cdef class Capabilities:
7475
if server_caps[TNS_CCAP_FIELD_VERSION] < self.ttc_field_version:
7576
self.ttc_field_version = server_caps[TNS_CCAP_FIELD_VERSION]
7677
self.compile_caps[TNS_CCAP_FIELD_VERSION] = self.ttc_field_version
78+
if server_caps[TNS_CCAP_TTC4] & TNS_CCAP_EXPLICIT_BOUNDARY:
79+
self.supports_request_boundaries = True
7780

7881
@cython.boundscheck(False)
7982
cdef void _adjust_for_server_runtime_caps(self, bytearray server_caps):
8083
if server_caps[TNS_RCAP_TTC] & TNS_RCAP_TTC_32K:
8184
self.max_string_size = 32767
8285
else:
8386
self.max_string_size = 4000
87+
if not (server_caps[TNS_RCAP_TTC] & TNS_RCAP_TTC_SESSION_STATE_OPS):
88+
self.supports_request_boundaries = False
8489

8590
cdef int _check_ncharset_id(self) except -1:
8691
"""

src/oracledb/impl/thin/constants.pxi

+1
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ cdef enum:
476476
TNS_RCAP_COMPAT_81 = 2
477477
TNS_RCAP_TTC_ZERO_COPY = 0x01
478478
TNS_RCAP_TTC_32K = 0x04
479+
TNS_RCAP_TTC_SESSION_STATE_OPS = 0x10
479480

480481
# verifier types
481482
cdef enum:

src/oracledb/impl/thin/pool.pyx

+3-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ cdef class BaseThinPoolImpl(BasePoolImpl):
200200
list of busy connections and is marked as being in a request.
201201
"""
202202
self._busy_conn_impls.append(conn_impl)
203-
conn_impl._session_state_desired = TNS_SESSION_STATE_REQUEST_BEGIN
204-
conn_impl._in_request = True
203+
if conn_impl._protocol._caps.supports_request_boundaries:
204+
conn_impl._session_state_desired = TNS_SESSION_STATE_REQUEST_BEGIN
205+
conn_impl._in_request = True
205206
return conn_impl
206207

207208
cdef int _post_create_conn_impl(self,

0 commit comments

Comments
 (0)