@@ -46,7 +46,6 @@ cdef class BaseThinConnImpl(BaseConnImpl):
46
46
bint _client_identifier_modified
47
47
str _module
48
48
bint _module_modified
49
- BaseThinPoolImpl _pool
50
49
bytes _ltxid
51
50
str _current_schema
52
51
bint _current_schema_modified
@@ -70,6 +69,7 @@ cdef class BaseThinConnImpl(BaseConnImpl):
70
69
int _dbobject_type_cache_num
71
70
bytes _combo_key
72
71
str _connection_id
72
+ bint _is_pooled
73
73
bint _is_pool_extra
74
74
bytes _transaction_context
75
75
uint8_t pipeline_mode
@@ -174,11 +174,6 @@ cdef class BaseThinConnImpl(BaseConnImpl):
174
174
message.context = self ._transaction_context
175
175
return message
176
176
177
- cdef int _force_close(self ) except - 1 :
178
- self ._pool = None
179
- self ._clear_dbobject_type_cache()
180
- self ._protocol._force_close()
181
-
182
177
cdef Statement _get_statement(self , str sql = None ,
183
178
bint cache_statement = False ):
184
179
"""
@@ -198,11 +193,8 @@ cdef class BaseThinConnImpl(BaseConnImpl):
198
193
self ._drcp_enabled = description.server_type == " pooled"
199
194
if self ._cclass is None :
200
195
self ._cclass = description.cclass
201
- if self ._cclass is None and self ._pool is not None \
202
- and self ._drcp_enabled:
203
- gen_uuid = uuid.uuid4()
204
- self ._cclass = f" DPY:{base64.b64encode(gen_uuid.bytes).decode()}"
205
- params._default_description.cclass = self ._cclass
196
+ if self ._cclass is None :
197
+ self ._cclass = params._default_description.cclass
206
198
207
199
cdef int _post_connect_phase_two(self , ConnectParamsImpl params) except - 1 :
208
200
"""
@@ -350,6 +342,13 @@ cdef class ThinConnImpl(BaseThinConnImpl):
350
342
BaseThinConnImpl.__init__ (self , dsn, params)
351
343
self ._protocol = Protocol()
352
344
345
+ cdef int _close(self ):
346
+ """
347
+ Internal method for closing the connection.
348
+ """
349
+ cdef Protocol protocol = < Protocol> self ._protocol
350
+ protocol._close(self )
351
+
353
352
cdef int _connect_with_address(self , Address address,
354
353
Description description,
355
354
ConnectParamsImpl params,
@@ -441,9 +440,12 @@ cdef class ThinConnImpl(BaseThinConnImpl):
441
440
protocol._process_single_message(message)
442
441
443
442
def close (self , bint in_del = False ):
443
+ """
444
+ Internal method for closing the connection to the database.
445
+ """
444
446
cdef Protocol protocol = < Protocol> self ._protocol
445
447
try :
446
- protocol._close (self )
448
+ protocol.close (self , in_del )
447
449
except (ssl.SSLError, exceptions.DatabaseError):
448
450
pass
449
451
@@ -455,17 +457,17 @@ cdef class ThinConnImpl(BaseThinConnImpl):
455
457
protocol._process_single_message(message)
456
458
457
459
def connect (self , ConnectParamsImpl params ):
458
- # specify that binding a string to a LOB value is possible in thin
459
- # mode without the use of asyncio (will be removed in a future release)
460
- self ._allow_bind_str_to_lob = True
461
-
460
+ cdef Protocol protocol = < Protocol> self ._protocol
462
461
try :
463
462
self ._pre_connect(params)
464
463
self ._connect_with_params(params)
465
464
self ._post_connect_phase_two(params)
466
465
except :
467
- self ._force_close ()
466
+ protocol._disconnect ()
468
467
raise
468
+ # specify that binding a string to a LOB value is possible in thin
469
+ # mode without the use of asyncio (will be removed in a future release)
470
+ self ._allow_bind_str_to_lob = True
469
471
470
472
def create_queue_impl (self ):
471
473
return ThinQueueImpl.__new__ (ThinQueueImpl)
@@ -954,7 +956,7 @@ cdef class AsyncThinConnImpl(BaseThinConnImpl):
954
956
"""
955
957
cdef BaseAsyncProtocol protocol = < BaseAsyncProtocol> self ._protocol
956
958
try :
957
- await protocol._close (self )
959
+ await protocol.close (self , in_del )
958
960
except (ssl.SSLError, exceptions.DatabaseError):
959
961
pass
960
962
@@ -979,7 +981,7 @@ cdef class AsyncThinConnImpl(BaseThinConnImpl):
979
981
await self ._connect_with_params(params)
980
982
self ._post_connect_phase_two(params)
981
983
except :
982
- self ._force_close ()
984
+ protocol._disconnect ()
983
985
raise
984
986
985
987
def create_queue_impl (self ):
0 commit comments