Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cursor close and connection close behaviour #529

Open
hashhar opened this issue Feb 5, 2025 · 1 comment
Open

Improve cursor close and connection close behaviour #529

hashhar opened this issue Feb 5, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@hashhar
Copy link
Member

hashhar commented Feb 5, 2025

From #405 (comment)

In my head the logic should be:

  • On cursor.close()
    • Cancel any already executing queries if they exist
    • Perform implicit ROLLBACK if within a transaction
    • Set some boolean so that calling any method of the cursor leads to Error

We don't do steps 2 and 3 here (both required by DB-API).

  • On cursor.cancel() - this is not a DB-API specified method so the behaviour is up to us to specify
    • Cancel any already executing queries
      • If query already finished, return False
      • If query is running and was cancelled successfully, return True
      • If no query was executed at all (how to differentiate between this and already finished? - presence of query on the cursor?) then raise Exception
@hashhar hashhar added the enhancement New feature or request label Feb 5, 2025
@hashhar
Copy link
Member Author

hashhar commented Feb 27, 2025

We can focus on implementing "Set some boolean so that calling any method of the cursor leads to Error" for cursor.close() as that's the main thing we are missing. Transactions are not supported properly anyway so whether we ROLLBACK or not doesn't seem important for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants