Class CopperTransactionController

    • Constructor Detail

      • CopperTransactionController

        public CopperTransactionController()
      • CopperTransactionController

        public CopperTransactionController​(javax.sql.DataSource dataSource)
    • Method Detail

      • setDataSource

        public void setDataSource​(javax.sql.DataSource dataSource)
      • setMaxConnectRetries

        public void setMaxConnectRetries​(int maxConnectRetries)
      • run

        public <T> T run​(DatabaseTransaction<T> txn)
                  throws java.lang.Exception
        Description copied from interface: TransactionController
        Runs a database transaction, i.e. a database connection is aquired and the provided DatabaseTransaction object is executed in the scope of a transaction.
        Specified by:
        run in interface TransactionController
        Type Parameters:
        T - return type which is passed back by the succeeded transaction. Might be null if transaction runs without giving a result.
        Parameters:
        txn - a database transaction object which will be run by the transaction controller.
        Returns:
        the result of the transaction if any.
        Throws:
        java.lang.Exception - if something goes wrong within the given transaction which is not caught by itself or if something goes wrong with the transaction management like getConnection throws an SQLException.
      • run

        public <T> T run​(Transaction<T> txn)
                  throws java.lang.Exception
        Description copied from interface: TransactionController
        Runs a transaction, the provided DatabaseTransaction object is executed in the scope of a transaction. A database, JMS, or any other connection may be aquired later on in this transaction, but to do so is in the scope of the Transaction object. The TransactionController is just defining the start and end of the transaction.
        Specified by:
        run in interface TransactionController
        Type Parameters:
        T - return type which is passed back by the succeeded transaction. Might be null if transaction runs without giving a result.
        Parameters:
        txn - a database transaction object which will be run by the transaction controller
        Returns:
        the result of the transaction if any.
        Throws:
        java.lang.Exception - if something goes wrong within the given transaction which is not caught by itself or if something goes wrong with the transaction management like getConnection throws an SQLException.