You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside code using Connection objects to issue queries, it would be nice to assert that the Connection is inside a transaction. This allows production code using the library to nicely separate the code handling the fetching of Connections from the code issuing queries while still allowing the latter to make assertions about the context it's in.
Looking at the code, there is a member variable _top_xact which is None if not inside a transaction block, and which is set to the Transaction object otherwise. Thus, it appears to me that simply checking the value of this variable is sufficient for this method. Correct me if I'm missing anything.
The text was updated successfully, but these errors were encountered:
Inside code using Connection objects to issue queries, it would be nice to assert that the Connection is inside a transaction. This allows production code using the library to nicely separate the code handling the fetching of Connections from the code issuing queries while still allowing the latter to make assertions about the context it's in.
Looking at the code, there is a member variable
_top_xact
which is None if not inside a transaction block, and which is set to the Transaction object otherwise. Thus, it appears to me that simply checking the value of this variable is sufficient for this method. Correct me if I'm missing anything.The text was updated successfully, but these errors were encountered: