@@ -1317,7 +1317,8 @@ defmodule Ecto.Repo do
1317
1317
1318
1318
In case a changeset is given, the changes in the changeset are
1319
1319
merged with the struct fields, and all of them are sent to the
1320
- database.
1320
+ database. If more than one database operation is required, they're
1321
+ automatically wrapped in a transaction.
1321
1322
1322
1323
It returns `{:ok, struct}` if the struct has been successfully
1323
1324
inserted or `{:error, changeset}` if there was a validation
@@ -1484,7 +1485,8 @@ defmodule Ecto.Repo do
1484
1485
A changeset is required as it is the only mechanism for
1485
1486
tracking dirty changes. Only the fields present in the `changes` part
1486
1487
of the changeset are sent to the database. Any other, in-memory
1487
- changes done to the schema are ignored.
1488
+ changes done to the schema are ignored. If more than one database
1489
+ operation is required, they're automatically wrapped in a transaction.
1488
1490
1489
1491
If the struct has no primary key, `Ecto.NoPrimaryKeyFieldError`
1490
1492
will be raised.
@@ -1591,7 +1593,9 @@ defmodule Ecto.Repo do
1591
1593
1592
1594
If the struct has no primary key, `Ecto.NoPrimaryKeyFieldError`
1593
1595
will be raised. If the struct has been removed from db prior to
1594
- call, `Ecto.StaleEntryError` will be raised.
1596
+ call, `Ecto.StaleEntryError` will be raised. If more than one
1597
+ database operation is required, they're automatically wrapped
1598
+ in a transaction.
1595
1599
1596
1600
It returns `{:ok, struct}` if the struct has been successfully
1597
1601
deleted or `{:error, changeset}` if there was a validation
0 commit comments