# Avoid redundant database roundtrips

**URL:** <https://forum.elixirforum.com/t/avoid-redundant-database-roundtrips/29908>\
**Category:** Questions\
**Tags:** backend\
**Created:** [March 19, 2020, 9:05am UTC](https://forum.elixirforum.com/t/avoid-redundant-database-roundtrips/29908 "2020-03-19T09:05:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Goose97](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/goose97/32/33793_2.png) [@Goose97](https://forum.elixirforum.com/u/Goose97)\
**Post date:** [March 19, 2020, 11:21am UTC](https://forum.elixirforum.com/t/avoid-redundant-database-roundtrips/29908/3 "2020-03-19T11:21:10Z")

</div>

Thanks @LostKobrakai  
I do a quick check. Is it what you meant?

```elixir
Multi.new()
|> Multi.run(:validate_coupon, fn _repo, _ ->
  validate_coupon(coupon_id)
end)
|> Multi.run(:increase_counter, fn _repo, _ ->
  increase_counter(coupon_id)
end)
|> Repo.transaction()

```

I’m searching in the doc but it’s seems like there are still two roundtrips to the databases. Did i miss something?

---

_[View the full topic](https://forum.elixirforum.com/t/avoid-redundant-database-roundtrips/29908)._
