Interface Transaction

  • All Known Implementing Classes:
    JdbcTransaction, ManagedTransaction

    public interface Transaction
    Wraps a database connection. Handles the connection lifecycle that comprises: its creation, preparation, commit/rollback and close.
    Author:
    Clinton Begin
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close inner database connection.
      void commit()
      Commit inner database connection.
      java.sql.Connection getConnection()
      Retrieve inner database connection.
      java.lang.Integer getTimeout()
      Get transaction timeout if set.
      void rollback()
      Rollback inner database connection.
    • Method Detail

      • getConnection

        java.sql.Connection getConnection()
                                   throws java.sql.SQLException
        Retrieve inner database connection.
        Returns:
        DataBase connection
        Throws:
        java.sql.SQLException
      • commit

        void commit()
             throws java.sql.SQLException
        Commit inner database connection.
        Throws:
        java.sql.SQLException
      • rollback

        void rollback()
               throws java.sql.SQLException
        Rollback inner database connection.
        Throws:
        java.sql.SQLException
      • close

        void close()
            throws java.sql.SQLException
        Close inner database connection.
        Throws:
        java.sql.SQLException
      • getTimeout

        java.lang.Integer getTimeout()
                              throws java.sql.SQLException
        Get transaction timeout if set.
        Throws:
        java.sql.SQLException