Skip to content
Discussion options

You must be logged in to vote

Thanks for the suggestion, but adding more features to the Transactional plugin beside propagating the transaction object is a non-goal.

The transaction is committed when the method decorated with a @Transactional returns successfully, you can then call whatever functions you want.

Option 1

The easiest userland solution is just to call it explicitly after a @Transactional-decorated method ends

async someAction(input: Input): Promise<Output> {
  await this.someActionTransaction()
    .then((value) => this.updateState(value))
}

@Transactional()
async someActionTransaction(input: Input): Promise<Output> { /* ... */}

Option 2

Another options is to use TransactionHost#withTransaction

async so…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KamalAman
Comment options

Answer selected by Papooch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants