-
Notifications
You must be signed in to change notification settings - Fork 270
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
Conversation
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.
…URL variable, and always committing session so as to release locks.
…ance variable to track transaction status, and retaining session between calls to execute, among other things.
There was a problem hiding this 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?
Okay, sounds good.
|
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.