Skip to content

Question about singleton ICapPublisher and transaction safety #1751

@xingyi5990

Description

@xingyi5990

Hi, I have a question regarding CAP. Currently, ICapPublisher is registered as a singleton. Can I safely assign a value directly to ICapPublisher.Transaction? How does CAP ensure that, even though ICapPublisher is a singleton, transactions remain isolated and do not conflict across multiple concurrent requests?

For example, in a high-concurrency scenario where multiple requests start MongoDB transactions simultaneously, each request might call StartTransaction on the singleton ICapPublisher. I am curious how CAP guarantees that these transactions are isolated and do not interfere with each other.

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