Skip to content

Commit da9b27e

Browse files
Update lib/ecto/repo.ex
Co-authored-by: Matt Enlow <enlow@adobe.com>
1 parent 9a9f133 commit da9b27e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ecto/repo.ex

+4-2
Original file line numberDiff line numberDiff line change
@@ -2226,8 +2226,10 @@ defmodule Ecto.Repo do
22262226
22272227
If an Elixir exception occurs the transaction will be rolled back
22282228
and the exception will bubble up from the transaction function.
2229-
If no exception occurs, the transaction is committed when the
2230-
function returns. A transaction can be explicitly rolled back
2229+
If no exception occurs, the transaction is committed if the function
2230+
returns `{:ok, result}`. Returning `{:error, result}` will rollback the transaction
2231+
and this function will return `{:error, result}` as well.
2232+
A transaction can be explicitly rolled back
22312233
by calling `c:rollback/1`, this will immediately leave the function
22322234
and return the value given to `rollback` as `{:error, value}`.
22332235

0 commit comments

Comments
 (0)