@@ -46,7 +46,6 @@ cdef class BaseThinConnImpl(BaseConnImpl):
4646 bint _client_identifier_modified
4747 str  _module
4848 bint _module_modified
49-  BaseThinPoolImpl _pool
5049 bytes _ltxid
5150 str  _current_schema
5251 bint _current_schema_modified
@@ -70,6 +69,7 @@ cdef class BaseThinConnImpl(BaseConnImpl):
7069 int  _dbobject_type_cache_num
7170 bytes _combo_key
7271 str  _connection_id
72+  bint _is_pooled
7373 bint _is_pool_extra
7474 bytes _transaction_context
7575 uint8_t pipeline_mode
@@ -174,11 +174,6 @@ cdef class BaseThinConnImpl(BaseConnImpl):
174174 message.context =  self ._transaction_context
175175 return  message
176176
177-  cdef int  _force_close(self ) except  - 1 :
178-  self ._pool =  None 
179-  self ._clear_dbobject_type_cache()
180-  self ._protocol._force_close()
181- 
182177 cdef Statement _get_statement(self , str  sql  =  None ,
183178 bint cache_statement  =  False ):
184179 """ 
@@ -198,11 +193,8 @@ cdef class BaseThinConnImpl(BaseConnImpl):
198193 self ._drcp_enabled =  description.server_type ==  " pooled" 
199194 if  self ._cclass is  None :
200195 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
206198
207199 cdef int  _post_connect_phase_two(self , ConnectParamsImpl params) except  - 1 :
208200 """ 
@@ -350,6 +342,13 @@ cdef class ThinConnImpl(BaseThinConnImpl):
350342 BaseThinConnImpl.__init__ (self , dsn, params)
351343 self ._protocol =  Protocol()
352344
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+ 
353352 cdef int  _connect_with_address(self , Address address,
354353 Description description,
355354 ConnectParamsImpl params,
@@ -441,9 +440,12 @@ cdef class ThinConnImpl(BaseThinConnImpl):
441440 protocol._process_single_message(message)
442441
443442 def  close (self , bint in_del = False ):
443+  """ 
444+  Internal method for closing the connection to the database. 
445+  """  
444446 cdef Protocol protocol =  < Protocol>  self ._protocol
445447 try :
446-  protocol._close (self )
448+  protocol.close (self , in_del )
447449 except  (ssl.SSLError, exceptions.DatabaseError):
448450 pass 
449451
@@ -455,17 +457,17 @@ cdef class ThinConnImpl(BaseThinConnImpl):
455457 protocol._process_single_message(message)
456458
457459 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
462461 try :
463462 self ._pre_connect(params)
464463 self ._connect_with_params(params)
465464 self ._post_connect_phase_two(params)
466465 except :
467-  self ._force_close ()
466+  protocol._disconnect ()
468467 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 
469471
470472 def  create_queue_impl (self ):
471473 return  ThinQueueImpl.__new__ (ThinQueueImpl)
@@ -954,7 +956,7 @@ cdef class AsyncThinConnImpl(BaseThinConnImpl):
954956 """  
955957 cdef BaseAsyncProtocol protocol =  < BaseAsyncProtocol>  self ._protocol
956958 try :
957-  await protocol._close (self )
959+  await protocol.close (self , in_del )
958960 except  (ssl.SSLError, exceptions.DatabaseError):
959961 pass 
960962
@@ -979,7 +981,7 @@ cdef class AsyncThinConnImpl(BaseThinConnImpl):
979981 await self ._connect_with_params(params)
980982 self ._post_connect_phase_two(params)
981983 except :
982-  self ._force_close ()
984+  protocol._disconnect ()
983985 raise 
984986
985987 def  create_queue_impl (self ):
0 commit comments