File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Thin Mode Changes
2020 :data: `ConnectionPool.timeout ` seconds.
2121#) Fixed bug using :attr: `Cursor.arraysize ` for tuning data fetches from REF
2222 CURSORS.
23+ #) Fixed bugs in the implementation of the statement cache.
2324
2425Thick Mode Changes
2526++++++++++++++++++
Original file line number Diff line number Diff line change @@ -238,11 +238,12 @@ cdef class ThinConnImpl(BaseConnImpl):
238238 if statement is None :
239239 statement = Statement()
240240 statement._prepare(sql)
241- if len (self ._statement_cache) < self ._statement_cache_size \
242- and cache_statement \
243- and not self ._drcp_establish_session:
244- self ._statement_cache[sql] = statement
241+ if cache_statement and not self ._drcp_establish_session \
242+ and not statement._is_ddl \
243+ and self ._statement_cache_size > 0 :
245244 statement._return_to_cache = True
245+ self ._statement_cache[sql] = statement
246+ self ._adjust_statement_cache()
246247 elif statement._in_use or not cache_statement \
247248 or self ._drcp_establish_session:
248249 if not cache_statement:
@@ -284,8 +285,6 @@ cdef class ThinConnImpl(BaseConnImpl):
284285 with self ._statement_cache_lock:
285286 if statement._return_to_cache:
286287 statement._in_use = False
287- self ._statement_cache.move_to_end(statement._sql)
288- self ._adjust_statement_cache()
289288 elif statement._cursor_id != 0 :
290289 self ._add_cursor_to_close(statement)
291290
You can’t perform that action at this time.
0 commit comments