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<PreparedStatement>> handler)` Create a prepared 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

    - ### Methods inherited from interface io.vertx.sqlclient.SqlClient

      `preparedQuery, query`

- - ### Method Detail

    - #### prepare

          Transaction prepare(String sql,
                              Handler<AsyncResult<PreparedStatement>> 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

    - #### close

          void close()

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

Copyright © 2022 Eclipse. All rights reserved.