Skip to content

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

Open
@itunic

Description

@itunic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions