Skip to content

Commit

Permalink
Fix: cursor handling for multiple cursors in a single transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneBakkerCineca committed Feb 20, 2023
1 parent 87d10c3 commit d4b9e02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lwetl/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ def close_all_cursors(self):
self.close(cs.cursor)
self.cursors = cursor_list

def remove_cursor(self, cursor: Cursor):
cursor_list = [cs for cs in self.cursors if cs.cursor != cursor]
self.cursors = cursor_list

@default_cursor(False)
def close(self, cursor: Union[Cursor, str, None] = None):
"""
Expand All @@ -494,6 +498,7 @@ def close(self, cursor: Union[Cursor, str, None] = None):
else:
if cursor == self.current_cursor:
self.current_cursor = None
self.remove_cursor(cursor)
# noinspection PyBroadException
try:
# for garbage collection
Expand Down
2 changes: 1 addition & 1 deletion lwetl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.7.7.master-ed9e3b511c413c6dcdb4f8e414f2b2d3a9207e80'
__version__ = '0.7.8.master-87d10c3a8c0ccfbe8204277e8edc86b61f659948'

0 comments on commit d4b9e02

Please sign in to comment.