How to Use Independent Transactions in Flask-SQLAlchemy?

Viewed 36

I want to split work into two independent database transactions. Will the following work as expected?

from flask_sqlalchemy import SQLAlchemy

db1 = SQLAlchemy()
db2 = SQLAlchemy()

... do work with db1
... do work with db2

db2.session.commit()
db1.session.rollback()
0 Answers
Related