File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,9 @@ cdef class ThinConnImpl(BaseConnImpl):
220220
221221 cdef int _force_close(self ) except - 1 :
222222 self ._pool = None
223+ if self ._dbobject_type_cache_num > 0 :
224+ remove_dbobject_type_cache(self ._dbobject_type_cache_num)
225+ self ._dbobject_type_cache_num = 0
223226 self ._protocol._force_close()
224227
225228 cdef Statement _get_statement(self , str sql, bint cache_statement):
@@ -301,9 +304,6 @@ cdef class ThinConnImpl(BaseConnImpl):
301304
302305 def close (self , bint in_del = False ):
303306 try :
304- if self ._dbobject_type_cache_num > 0 :
305- remove_dbobject_type_cache(self ._dbobject_type_cache_num)
306- self ._dbobject_type_cache_num = 0
307307 self ._protocol._close(self )
308308 except (ssl.SSLError, exceptions.DatabaseError):
309309 pass
Original file line number Diff line number Diff line change @@ -107,10 +107,14 @@ cdef class Protocol:
107107
108108 # if the connection is part of a pool, return it to the pool
109109 if conn_impl._pool is not None :
110- conn_impl._pool._return_connection(conn_impl)
110+ return conn_impl._pool._return_connection(conn_impl)
111111
112- # otherwise, send the logoff message and final close
113- elif self ._socket is not None :
112+ # otherwise, destroy the database object type cache, send the
113+ # logoff message and final close packet
114+ if conn_impl._dbobject_type_cache_num > 0 :
115+ remove_dbobject_type_cache(conn_impl._dbobject_type_cache_num)
116+ conn_impl._dbobject_type_cache_num = 0
117+ if self ._socket is not None :
114118 if not conn_impl._drcp_enabled:
115119 message = conn_impl._create_message(LogoffMessage)
116120 self ._process_message(message)
You can’t perform that action at this time.
0 commit comments