Skip to content

Optionally allow committing a transaction when an error occurs #59

@ggat

Description

@ggat

Can we commit a transaction when an error happens, if we wanted to.

@Transactional()
async savePhoneNumber(...) {
  await this.userRepo.save({ phone: ... })
  // I would like the transaction to commit at this point, so that the error doesn't cause it to rollback
  throw new Error('fake error')
}

Side note, something can be achieved with @Transactional( { propagation: Propagation.NESTED } ), but then it's a breeze for somebody to come and introduce deadlocks, and we already had few such cases, thus we try to avoid it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions