Skip to content

Commit 600feca

Browse files
Fixed regression resulting in cursor leak (#513).
1 parent 6885890 commit 600feca

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

doc/src/release_notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Thin Mode Changes
3333
Thick Mode Changes
3434
++++++++++++++++++
3535

36+
#) Fixed regression resulting in cursor leak
37+
(`issue 513 <https://github.com/oracle/python-oracledb/issues/513>`__).
38+
39+
3640
Common Changes
3741
++++++++++++++
3842

src/oracledb/impl/thick/var.pyx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ cdef class ThickVarImpl(BaseVarImpl):
120120
ThickCursorImpl cursor_impl
121121
object cursor
122122
cursor = self._values[pos]
123-
if cursor is None:
124-
cursor = self._conn.cursor()
123+
if cursor is not None:
124+
cursor_impl = <ThickCursorImpl> cursor._impl
125+
if cursor_impl._handle == dbvalue.asStmt:
126+
cursor_impl._fixup_ref_cursor = True
127+
return cursor
128+
cursor = self._conn.cursor()
125129
cursor_impl = <ThickCursorImpl> cursor._impl
126130
if dpiStmt_addRef(dbvalue.asStmt) < 0:
127131
_raise_from_odpi()

0 commit comments

Comments
 (0)