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 @@ -15,6 +15,7 @@ Thin Mode Changes
1515
1616#) Fixed bug connecting to databases with older 11g password verifiers
1717 (`issue 189 <https://github.com/oracle/python-oracledb/issues/189 >`__).
18+ #) Fixed bugs in the implementation of the statement cache.
1819
1920Thick Mode Changes
2021++++++++++++++++++
Original file line number Diff line number Diff line change @@ -237,11 +237,12 @@ cdef class ThinConnImpl(BaseConnImpl):
237237 if statement is None :
238238 statement = Statement()
239239 statement._prepare(sql)
240- if len (self ._statement_cache) < self ._statement_cache_size \
241- and cache_statement \
242- and not self ._drcp_establish_session:
243- self ._statement_cache[sql] = statement
240+ if cache_statement and not self ._drcp_establish_session \
241+ and not statement._is_ddl \
242+ and self ._statement_cache_size > 0 :
244243 statement._return_to_cache = True
244+ self ._statement_cache[sql] = statement
245+ self ._adjust_statement_cache()
245246 elif statement._in_use or not cache_statement \
246247 or self ._drcp_establish_session:
247248 if not cache_statement:
@@ -283,8 +284,6 @@ cdef class ThinConnImpl(BaseConnImpl):
283284 with self ._statement_cache_lock:
284285 if statement._return_to_cache:
285286 statement._in_use = False
286- self ._statement_cache.move_to_end(statement._sql)
287- self ._adjust_statement_cache()
288287 elif statement._cursor_id != 0 :
289288 self ._add_cursor_to_close(statement)
290289
You can’t perform that action at this time.
0 commit comments