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
20
20
:data: `ConnectionPool.timeout ` seconds.
21
21
#) Fixed bug using :attr: `Cursor.arraysize ` for tuning data fetches from REF
22
22
CURSORS.
23
+ #) Fixed bugs in the implementation of the statement cache.
23
24
24
25
Thick Mode Changes
25
26
++++++++++++++++++
Original file line number Diff line number Diff line change @@ -238,11 +238,12 @@ cdef class ThinConnImpl(BaseConnImpl):
238
238
if statement is None :
239
239
statement = Statement()
240
240
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 :
245
244
statement._return_to_cache = True
245
+ self ._statement_cache[sql] = statement
246
+ self ._adjust_statement_cache()
246
247
elif statement._in_use or not cache_statement \
247
248
or self ._drcp_establish_session:
248
249
if not cache_statement:
@@ -284,8 +285,6 @@ cdef class ThinConnImpl(BaseConnImpl):
284
285
with self ._statement_cache_lock:
285
286
if statement._return_to_cache:
286
287
statement._in_use = False
287
- self ._statement_cache.move_to_end(statement._sql)
288
- self ._adjust_statement_cache()
289
288
elif statement._cursor_id != 0 :
290
289
self ._add_cursor_to_close(statement)
291
290
You can’t perform that action at this time.
0 commit comments