-
In general, we want our API to work in an all-of-nothing approach. Therefore in most cases we start a DB transaction in the router so that all calls to the feature and lower levels are bundled in the same transaction. However, there are cases where we want to ensure that data is written to the DB in the feature level regardless of whether a transaction has been started or not (e.g. logging something or results from calling an external API). How is this possible in Gino? In other ORMs you can start a separate transaction, but in Gino |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Was able to make it work using the Manual Control for transactions, and wrap it up in a context manager:
Gino evidently does some magic that allows the implicit queries to work on the innermost transaction, even if it's unrelated to the enclosing one. |
Beta Was this translation helpful? Give feedback.
Was able to make it work using the Manual Control for transactions, and wrap it up in a context manager: