title: No rollback with quarkus, mutiny and reactive postgresql
body: <p>I am trying to get 3 inserts executed within the same transaction, but I am not able to get the transaction rolled back when one of the inserts fail.</p>
  
  <p>I am new in the reactive world and this is my very first reactive application.</p>
  
  <p>Here is a simplification of the database model:</p>
  
  <pre><code>EntityA 1---N EntityB
  EntityA 1---N EntityC
  </code></pre>
  
  <p>I want to execute the following inserts within the same transaction:</p>
  
  <pre class="lang-sql prettyprint-override"><code>INSERT INTO A
  INSERT INTO B  --(failing query)
  INSERT INTO C
  </code></pre>
  
  <p>But, when the second insert fails, the first insert does not rollback.</p>
  
  <p>I've got the following classes:</p>
  
  <ul>
  <li><code>Processor</code>: receives a message from kafka and triggers the inserts though a Service</li>
  <li><code>Service</code>: runs the 3 inserts by using 3 DAOs</li>
  <li><code>EntityADao</code>: runs the insert of the entity A</li>
  <li><code>EntityBDao</code>: runs the insert of the entity B</li>
  <li><code>EntityBDao</code>: runs the insert of the entity C</li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>@ApplicationScoped
  public class Processor {
      private final Service service;
  
      public Processor(final Service service) {
          this.service = service;
      }
  
      @Incoming("input-channel")
      @Outgoing("output-channel")
      public Uni&lt;Message&lt;RequestMessage&gt;&gt; process(final Message&lt;RequestMessage&gt; message) {
          final RequestMessage rm = message.getPayload();
  
          return service.saveEntities(rm)
                  .onFailure()
                      .recoverWithItem(e -&gt; {
                          final String errorMessage = "There was an unexpected error while saving entities";
                          LOG.error(errorMessage, e);
  
                          return Result.KO;
                      })
                  .flatMap(result -&gt; {
                      rm.setResult(result);
  
                      return Uni.createFrom()
                          .item(Message.of(rm), message::ack))
                  });
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>@ApplicationScoped
  public class WorkerService {
      private final EntityADao entityADao;
      private final EntityBDao entityBDao;
      private final EntityCDao entityCDao;
  
      public WorkerService(final EntityADao entityADao,
                           final EntityBDao entityBDao,
                           final EntityCDao entityCDao) {
          this.entityADao = entityADao;
          this.entityBDao = entityBDao;
          this.entityCDao = entityCDao;
      }
  
      @Transactional(TxType.REQUIRED)
      public Uni&lt;Result&gt; saveEntities(final RequestMessage requestMessage) {
          return Uni.createFrom().item(Result.OK)
                  // Save Entity A
                  .flatMap(result -&gt; {
                      LOG.debug("(1) Saving EntityA ...");
  
                      return entityADao.save(requestMessage.getEntityAData());
                  })
                  // Save Entity B
                  .flatMap(result -&gt; {
                      LOG.debug("(2) Saving EntityB ...");
  
                      return entityBDao.save(requestMessage.getEntityBData());
                  })
                  // Save Entity C
                  .flatMap(result -&gt; {
                      LOG.debug("(3) Saving EntityC ...");
  
                      return entityCDao.dao(requestMessage.getEntityCData());
                  })
                  // Return OK
                  .flatMap(result -&gt; Uni.createFrom().item(Result.OK));
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>@ApplicationScoped
  public class EntityADao {
      private final PgPool client;
  
      public EntityADao(final PgPool client) {
          this.client = client;
      }
  
      @Transactional(TxType.MANDATORY)
      public Uni&lt;Result&gt; save(final EntityAData entityAData) {
          return client
                  .preparedQuery(
                          "INSERT INTO A(col1, col2, col3) " +
                              "VALUES ($1, $2, $3)")
                  .execute(Tuple.of(entityAData.col1(), entityAData.col2(), entityAData.col3()))
                  .flatMap(pgRowSet -&gt; {
                      LOG.debug("Inserted EntityA!");
  
                      return Result.OK;
                  });
      }
  }
  </code></pre>
  
  <p><code>EntityBDao</code> and <code>EntityCDao</code> are like <code>EntityADao</code>.</p>
  
  <p>I have already added the following dependencies to <code>pom.xml</code>:</p>
  
  <ul>
  <li><code>quarkus-smallrye-context-propagation</code></li>
  <li><code>quarkus-narayana-jta</code></li>
  </ul>
  
  <p><strong>Why when the <code>INSERT B</code> query in <code>EntityBDao</code> fails, the previously executed query (<code>INSERT A</code>) does not rollback? What do am I missing? What would I have to change in order to get this working?</strong></p>