File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ Thin Mode Changes
17
17
(`issue 276 <https://github.com/oracle/python-oracledb/issues/276 >`__).
18
18
#) Added support for the asynchronous context manager protocol on the
19
19
AsyncCursor class as a convenience.
20
+ #) Fixed regression when connecting to a database using listener redirects
21
+ with either a connection pool or using asyncio
22
+ (`issue 275 <https://github.com/oracle/python-oracledb/issues/275 >`__).
20
23
#) Fixed bug with intermittent hang on some versions of Oracle Database when
21
24
using asyncio and the database raises an error and output variables are
22
25
present
Original file line number Diff line number Diff line change @@ -304,8 +304,12 @@ cdef class Protocol(BaseProtocol):
304
304
self ._process_message(auth_message)
305
305
306
306
# mark protocol to indicate that connect is no longer in progress; this
307
- # allows the normal break/reset mechanism to fire
307
+ # allows the normal break/reset mechanism to fire; also mark the
308
+ # session as not needing to be closed since for listener redirects
309
+ # the packet may indicate EOF for the initial connection that is
310
+ # established
308
311
conn_impl.warning = auth_message.warning
312
+ self ._read_buf._session_needs_to_be_closed = False
309
313
self ._in_connect = False
310
314
311
315
cdef int _connect_tcp(self , ConnectParamsImpl params,
@@ -874,9 +878,12 @@ cdef class BaseAsyncProtocol(BaseProtocol):
874
878
def connection_lost (self , exc ):
875
879
"""
876
880
Called when a connection has been lost. The presence of an exception
877
- indicates an abornmal loss of the connection.
881
+ indicates an abornmal loss of the connection. If in the process of
882
+ establishing a connection, losing the connection is ignored since this
883
+ can happen normally when a listener redirect is encountered.
878
884
"""
879
- self ._transport = None
885
+ if not self ._in_connect:
886
+ self ._transport = None
880
887
881
888
def data_received (self , data ):
882
889
"""
You can’t perform that action at this time.
0 commit comments