Skip to content

Commit 053b33b

Browse files
authored
Make things clearer regarding transactions in services (#76)
1 parent da280f0 commit 053b33b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/03-code-internals/19-service-objects.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ This step will run coercions and validations defined in the provided block. If t
130130

131131
This step is a bit special, as it will wrap any other steps defined in its block inside a SQL transaction.
132132

133+
Any step that fails inside the transaction block will cause a rollback of the transaction.
134+
133135
### `try`
134136

135137
This step will catch exceptions raised by the steps defined in its block. Specific exception classes can be provided if you don’t want to automatically catch all exceptions.
@@ -375,7 +377,7 @@ The step will fail if the policy returns a falsy value. Its result object can be
375377

376378
### `transaction(&block)`
377379

378-
This step is a bit special as its only purpose is to wrap other steps inside a SQL transaction. It cannot fail by itself.
380+
This step is a bit special as its only purpose is to wrap other steps inside a SQL transaction. It cannot fail by itself but if a step fails inside the transaction block, the transaction will rollback.
379381

380382
### `try(*exceptions, &block)`
381383

0 commit comments

Comments
 (0)