io.vertx.sqlclient

## Interface Transaction

- All Superinterfaces:
    SqlClient

      public interface Transaction
      extends SqlClient

  A transaction that allows to control the transaction and receive events.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Transaction` | `abortHandler(Handler<Void> handler)` Set an handler to be called when the transaction is aborted.
    `void` | `close()` Rollback the transaction and release the associated resources.
    `void` | `commit()` Commit the current transaction.
    `void` | `commit(Handler<AsyncResult<Void>> handler)` Like `commit()` with an handler to be notified when the transaction commit has completed
    `Transaction` | `prepare(String sql, Handler<AsyncResult<PreparedQuery>> handler)` Create a prepared query.
    `<R> Transaction` | `preparedBatch(String sql, List<Tuple> batch, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a createBatch.
    `Transaction` | `preparedBatch(String sql, List<Tuple> batch, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a createBatch.
    `<R> Transaction` | `preparedQuery(String sql, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a query.
    `Transaction` | `preparedQuery(String sql, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a query.
    `<R> Transaction` | `preparedQuery(String sql, Tuple arguments, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a query.
    `Transaction` | `preparedQuery(String sql, Tuple arguments, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a query.
    `<R> Transaction` | `query(String sql, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Execute a simple query.
    `Transaction` | `query(String sql, Handler<AsyncResult<RowSet<Row>>> handler)` Execute a simple query.
    `void` | `rollback()` Rollback the current transaction.
    `void` | `rollback(Handler<AsyncResult<Void>> handler)` Like `rollback()` with an handler to be notified when the transaction rollback has completed

- - ### Method Detail

    - #### prepare

          Transaction prepare(String sql,
                              Handler<AsyncResult<PreparedQuery>> handler)

      Create a prepared query.
      Parameters:
        `sql` - the sql
        `handler` - the handler notified with the prepared query asynchronously

    - #### commit

          void commit()

      Commit the current transaction.

    - #### commit

          void commit(Handler<AsyncResult<Void>> handler)

      Like `commit()` with an handler to be notified when the transaction commit has completed

    - #### rollback

          void rollback()

      Rollback the current transaction.

    - #### rollback

          void rollback(Handler<AsyncResult<Void>> handler)

      Like `rollback()` with an handler to be notified when the transaction rollback has completed

    - #### abortHandler

          Transaction abortHandler(Handler<Void> handler)

      Set an handler to be called when the transaction is aborted.
      Parameters:
        `handler` - the handler

    - #### query

          Transaction query(String sql,
                            Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Execute a simple query.
      Specified by:
        `query` in interface `SqlClient`
      Parameters:
        `sql` - the query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### query

          <R> Transaction query(String sql,
                                java.util.stream.Collector<Row,?,R> collector,
                                Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Execute a simple query.
      Specified by:
        `query` in interface `SqlClient`
      Parameters:
        `sql` - the query SQL
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          Transaction preparedQuery(String sql,
                                    Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          <R> Transaction preparedQuery(String sql,
                                        java.util.stream.Collector<Row,?,R> collector,
                                        Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          Transaction preparedQuery(String sql,
                                    Tuple arguments,
                                    Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          <R> Transaction preparedQuery(String sql,
                                        Tuple arguments,
                                        java.util.stream.Collector<Row,?,R> collector,
                                        Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedBatch

          Transaction preparedBatch(String sql,
                                    List<Tuple> batch,
                                    Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a createBatch.
      Specified by:
        `preparedBatch` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedBatch

          <R> Transaction preparedBatch(String sql,
                                        List<Tuple> batch,
                                        java.util.stream.Collector<Row,?,R> collector,
                                        Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a createBatch.
      Specified by:
        `preparedBatch` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### close

          void close()

      Rollback the transaction and release the associated resources.
      Specified by:
        `close` in interface `SqlClient`

Copyright © 2019 Eclipse. All rights reserved.