Skip to content

Commit 65cbf6e

Browse files
Improved support for planned database maintenance by internally sending
explicit request boundaries when using python-oracledb connection pools.
1 parent 92fb448 commit 65cbf6e

File tree

8 files changed

+277
-211
lines changed

8 files changed

+277
-211
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Thin Mode Changes
2727
#) Added parameter :data:`ConnectParams.use_sni` to specify that the TLS SNI
2828
extension should be used to reduce the number of TLS neegotiations that are
2929
needed to connect to the database.
30+
#) Improved support for planned database maintenance by internally sending
31+
explicit request boundaries when using python-oracledb connection pools.
3032
#) Added parameter :data:`ConnectParams.instance_name` to specify the instance
3133
name to use when connecting to the database. Added support for setting the
3234
instance name in :ref:`Easy Connect strings <easyconnect>`.

src/oracledb/base_impl.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ cdef class BaseConnImpl:
616616
readonly bint supports_bool
617617
ssize_t _oson_max_fname_size
618618
bint _allow_bind_str_to_lob
619+
bint _in_request
619620

620621
cdef object _check_value(self, OracleMetadata type_info, object value,
621622
bint* is_ok)

src/oracledb/impl/thin/capabilities.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ cdef class Capabilities:
126126
self.compile_caps[TNS_CCAP_TTC2] = TNS_CCAP_ZLNP
127127
self.compile_caps[TNS_CCAP_OCI2] = TNS_CCAP_DRCP
128128
self.compile_caps[TNS_CCAP_CLIENT_FN] = TNS_CCAP_CLIENT_FN_MAX
129-
self.compile_caps[TNS_CCAP_TTC4] = TNS_CCAP_INBAND_NOTIFICATION
129+
self.compile_caps[TNS_CCAP_TTC4] = TNS_CCAP_INBAND_NOTIFICATION | \
130+
TNS_CCAP_EXPLICIT_BOUNDARY
130131
self.compile_caps[TNS_CCAP_TTC5] = TNS_CCAP_VECTOR_SUPPORT | \
131132
TNS_CCAP_TOKEN_SUPPORTED | TNS_CCAP_PIPELINING_SUPPORT | \
132133
TNS_CCAP_PIPELINING_BREAK

src/oracledb/impl/thin/connection.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ cdef class BaseThinConnImpl(BaseConnImpl):
7373
bint _is_pool_extra
7474
bytes _transaction_context
7575
uint8_t pipeline_mode
76+
uint8_t _session_state_desired
7677

7778
def __init__(self, str dsn, ConnectParamsImpl params):
7879
if not HAS_CRYPTOGRAPHY:

src/oracledb/impl/thin/constants.pxi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ cdef enum:
296296
TNS_FUNC_REEXECUTE_AND_FETCH = 78
297297
TNS_FUNC_SESSION_GET = 162
298298
TNS_FUNC_SESSION_RELEASE = 163
299+
TNS_FUNC_SESSION_STATE = 176
299300
TNS_FUNC_SET_SCHEMA = 152
300301
TNS_FUNC_TPC_TXN_SWITCH = 103
301302
TNS_FUNC_TPC_TXN_CHANGE_STATE = 104
@@ -399,6 +400,7 @@ cdef enum:
399400
TNS_CCAP_DRCP = 0x10
400401
TNS_CCAP_ZLNP = 0x04
401402
TNS_CCAP_INBAND_NOTIFICATION = 0x04
403+
TNS_CCAP_EXPLICIT_BOUNDARY = 0x40
402404
TNS_CCAP_END_OF_RESPONSE = 0x20
403405
TNS_CCAP_CLIENT_FN_MAX = 12
404406
TNS_CCAP_VECTOR_SUPPORT = 0x08
@@ -468,6 +470,12 @@ cdef enum:
468470
TNS_PIPELINE_MODE_CONTINUE_ON_ERROR = 1
469471
TNS_PIPELINE_MODE_ABORT_ON_ERROR = 2
470472

473+
# session state flags
474+
cdef enum:
475+
TNS_SESSION_STATE_REQUEST_BEGIN = 0x04
476+
TNS_SESSION_STATE_REQUEST_END = 0x08
477+
TNS_SESSION_STATE_EXPLICIT_BOUNDARY = 0x40
478+
471479
# other constants
472480
cdef enum:
473481
TNS_ESCAPE_CHAR = 253

0 commit comments

Comments
 (0)