Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Is it true that the "await transaction.start()" line is missing from the databases lower-level transaction API usage example? #596

@allyotov

Description

@allyotov

The database help suggests the following way to use the low-level transaction API:

transaction = await database.transaction()
try:
    ...
except:
    await transaction.rollback()
else:
    await transaction.commit()

But if I try to use this code as is, I guess, the created transaction is not started. So, maybe, we have to start it explicitly as follows?

transaction = await database.transaction()
await transaction.start()  # start transaction explicitly
try:
    ...
except:
    await transaction.rollback()
else:
    await transaction.commit()

Please confirm or deny my assumption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions