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 d4b9e02 commit 360573d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lwetl/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,6 @@ class Jdbc:
"""

CURSOR_MODE_USE_CURRENT = 0x01
CURSOR_MODE_DELETE_ON_COMMIT = 0x02

def __init__(self, login: str, auto_commit=False, upper_case=True):
"""
Init the jdbc connection.
Expand Down Expand Up @@ -709,7 +706,7 @@ def query(self, sql: str, parameters=None, return_type=tuple, max_rows=0, array_
@param array_size: batch size for which results are buffered when retrieving from the database
@return: iterator of the specified return type, or the return type if max_rows=1
"""
cur = self.execute(sql, parameters, cursor=None, keep_cursor=True)
cur = self.execute(sql, parameters, cursor=None, use_current_cursor=False, keep_cursor=True)
if cur.rowcount >= 0:
raise ValueError('The provided SQL is for updates, not to query. Use Execute method instead.')
return self.get_data(cur, return_type=return_type, include_none=False, max_rows=max_rows, array_size=array_size)
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.8.master-87d10c3a8c0ccfbe8204277e8edc86b61f659948'
__version__ = '0.7.9.master-d4b9e026cc8c7325b8ba212c49fedda57245d81d'

0 comments on commit 360573d

Please sign in to comment.