We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a9f133 commit da9b27eCopy full SHA for da9b27e
lib/ecto/repo.ex
@@ -2226,8 +2226,10 @@ defmodule Ecto.Repo do
2226
2227
If an Elixir exception occurs the transaction will be rolled back
2228
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
+ If no exception occurs, the transaction is committed if the function
+ 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
2233
by calling `c:rollback/1`, this will immediately leave the function
2234
and return the value given to `rollback` as `{:error, value}`.
2235
0 commit comments