Skip to content

Commit eeda016

Browse files
Fixed bug when using DRCP with a 23c Oracle Database.
1 parent d480381 commit eeda016

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

doc/src/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Thin Mode Changes
2525
#) Fixed bug which could cause a redirect loop with improperly configured
2626
listener redirects.
2727
#) Fixed bug when executing PL/SQL with a large number of binds.
28+
#) Fixed bug when using DRCP with a 23c Oracle Database.
2829

2930
Thick Mode Changes
3031
++++++++++++++++++

src/oracledb/impl/thin/messages.pyx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,3 +2238,26 @@ cdef class RollbackMessage(Message):
22382238
Perform initialization.
22392239
"""
22402240
self.function_code = TNS_FUNC_ROLLBACK
2241+
2242+
2243+
@cython.final
2244+
cdef class SessionReleaseMessage(Message):
2245+
2246+
cdef:
2247+
uint32_t release_mode
2248+
2249+
cdef int _initialize_hook(self) except -1:
2250+
"""
2251+
Perform initialization.
2252+
"""
2253+
self.message_type = TNS_MSG_TYPE_ONEWAY_FN
2254+
self.function_code = TNS_FUNC_SESSION_RELEASE
2255+
2256+
cdef int _write_message(self, WriteBuffer buf) except -1:
2257+
"""
2258+
Write the message for a DRCP session release.
2259+
"""
2260+
self._write_function_code(buf)
2261+
buf.write_uint8(0) # pointer (tag name)
2262+
buf.write_uint8(0) # tag name length
2263+
buf.write_ub4(self.release_mode) # mode

src/oracledb/impl/thin/protocol.pyx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ cdef class Protocol:
102102
message = conn_impl._create_message(RollbackMessage)
103103
self._process_message(message)
104104
if conn_impl._drcp_enabled:
105-
self._release_drcp_session(self._write_buf, release_mode)
105+
self._release_drcp_session(conn_impl, release_mode)
106106
conn_impl._drcp_establish_session = True
107107

108108
# if the connection is part of a pool, return it to the pool
@@ -397,20 +397,16 @@ cdef class Protocol:
397397
buf.skip_raw_bytes(3)
398398
message.error_info.message = buf.read_str(TNS_CS_IMPLICIT)
399399

400-
cdef int _release_drcp_session(self, WriteBuffer buf,
400+
cdef int _release_drcp_session(self, ThinConnImpl conn_impl,
401401
uint32_t release_mode) except -1:
402402
"""
403403
Release the session back to DRCP. Standalone sessions are marked for
404404
deauthentication.
405405
"""
406-
buf.start_request(TNS_PACKET_TYPE_DATA)
407-
buf.write_uint8(TNS_MSG_TYPE_ONEWAY_FN)
408-
buf.write_uint8(TNS_FUNC_SESSION_RELEASE)
409-
buf.write_uint8(0) # seq number
410-
buf.write_uint8(0) # pointer (tag name)
411-
buf.write_uint8(0) # tag name length
412-
buf.write_ub4(release_mode) # mode
413-
buf.end_request()
406+
cdef SessionReleaseMessage message
407+
message = conn_impl._create_message(SessionReleaseMessage)
408+
message.release_mode = release_mode
409+
message.send(self._write_buf)
414410

415411
cdef int _reset(self, Message message) except -1:
416412
cdef uint8_t marker_type

0 commit comments

Comments
 (0)