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

Regarding my query about the transaction handling in ModelManager... #24

Open
itunic opened this issue Feb 15, 2025 · 0 comments
Open

Comments

@itunic
Copy link

itunic commented Feb 15, 2025

Hello, I am very glad to come across such an excellent Rust web template project; it's really great. While reading the code, I have a question that needs discussion. In the new_with_txn method within the ModelManager, should there be an additional check to see if a transaction is already active in the current self? If so, there would be no need to start a new transaction. This approach ensures that during the transaction propagation, each piece of transactional code remains an independent segment. If ModelManager does not have an ongoing transaction, then one should be started; if a transaction already exists, the current MM should just be used directly. This not only simplifies the coding process but also guarantees the consistency of transactions. I wonder if my understanding is reasonable.

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

No branches or pull requests

1 participant