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

Transaction sessions; appcontext teardown fix; multiple databases in request fix. #122

Merged
merged 6 commits into from
Jun 12, 2020

Conversation

jsarchibald
Copy link
Contributor

Use sessions to handle transactions, allowing for both auto and manual commit modes. Registers Flask appcontext teardown function only once per database instance, and also allows for multiple database connections in a single Flask request.

Add unit tests for SQL savepoints, autocommit mode, manual transaction mode. Add integration tests for Flask.

commit modes. Registers Flask appcontext teardown function only once per
database instance, and also allows for multiple database connections in
a single Flask request.

Add unit tests for SQL savepoints, autocommit mode, manual transaction
mode. Add integration tests for Flask.
@jsarchibald jsarchibald requested a review from kzidane June 4, 2020 17:23
…URL variable, and always committing session so as to release locks.
@jsarchibald jsarchibald requested a review from dmalan June 4, 2020 19:33
…ance variable to track transaction status, and retaining session between calls to execute, among other things.
@jsarchibald jsarchibald requested a review from kzidane June 5, 2020 22:25
Copy link
Member

@kzidane kzidane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we concluded that it's fine to pass BEGIN|START TRANSACTION or COMMIT|ROLLBACK to Session.execute() or is that frowned upon or problematic in anyway? Would it make anything simpler or better if we instead retain sqlalchemy's (and/or the underlying API/driver) default behavior of emitting BEGIN|START TRANSACTION automatically and emitting COMMIT on when Session.commit() (or emitting ROLLBACK when Session.rollback()) is called and simply not pass these statements to Session.execute() and call the appropriate methods instead?

@dmalan
Copy link
Member

dmalan commented Jun 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants