Skip to content

Commit

Permalink
fix(transactional): correct behavior of Propagation.Never
Browse files Browse the repository at this point in the history
  • Loading branch information
Papooch committed Aug 6, 2024
1 parent 8916670 commit afb471a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/transactional/src/lib/propagation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ export enum Propagation {
*/
Required = 'REQUIRED',
/**
* Create a new transaction even if one already exists.
* Create a new transaction even if one already exists. The new transaction is committed independently of the existing one.
*/
RequiresNew = 'REQUIRES_NEW',
/**
* Run without a transaction even if one exists.
* Run without a transaction even if one exists. The existing transaction is resumed once the callback completes.
*/
NotSupported = 'NOT_SUPPORTED',
/**
* Reuse an existing transaction, throw an exception otherwise
* Reuse an existing transaction, throw an exception otherwise.
*/
Mandatory = 'MANDATORY',
/**
* Throw an exception if an existing transaction exists, otherwise create a new one
* Run without a transaction, throw an exception if one already exists.
*/
Never = 'NEVER',
}
Expand Down
2 changes: 1 addition & 1 deletion packages/transactional/src/lib/transaction-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class TransactionHost<TAdapter = never> {
if (this.isTransactionActive()) {
throw new TransactionAlreadyActiveError(fnName);
}
return this.runWithTransaction(options, fn);
return this.withoutTransaction(fn);
default:
throw new TransactionPropagationError(
`Unknown propagation mode ${propagation}`,
Expand Down

0 comments on commit afb471a

Please sign in to comment.