Class Transactions


  • public final class Transactions
    extends Object
    Provides utility methods for managing Transactions.
    • Method Detail

      • create

        public static io.toro.martini.transaction.TransactionFacade create()
        Creates an unstarted TransactionFacade.

        Callers must specifically invoke start first before commit or rollback.

        Returns:
        Transaction facade
      • create

        public static io.toro.martini.transaction.TransactionFacade create​(String name)
        Parameters:
        name - Transaction name
      • create

        public static io.toro.martini.transaction.TransactionFacade create​(int timeout)
        Parameters:
        timeout - Transaction timeout
      • create

        public static io.toro.martini.transaction.TransactionFacade create​(String name,
                                                                           String propagationBehavior)
        Parameters:
        name - Transaction name
        propagationBehavior - Transaction propagation behavior. Possible values are:

        PROPAGATION_REQUIRED, PROPAGATION_SUPPORTS, PROPAGATION_MANDATORY, PROPAGATION_REQUIRES_NEW PROPAGATION_NOT_SUPPORTED, PROPAGATION_NEVER, PROPAGATION_NESTED, AND PROPAGATION_DEFAULT.

      • create

        public static io.toro.martini.transaction.TransactionFacade create​(String name,
                                                                           String propagationBehavior,
                                                                           int timeout)
        Parameters:
        name - Transaction name
        propagationBehavior - Transaction propagation behavior. Possible values are:

        PROPAGATION_REQUIRED, PROPAGATION_SUPPORTS, PROPAGATION_MANDATORY, PROPAGATION_REQUIRES_NEW PROPAGATION_NOT_SUPPORTED, PROPAGATION_NEVER, PROPAGATION_NESTED, AND PROPAGATION_DEFAULT. * @param timeout Transaction

        timeout - Transaction timeout
      • create

        public static io.toro.martini.transaction.TransactionFacade create​(TransactionDefinition definition)
        Creates an unstarted TransactionFacade.

        Callers must specifically invoke start first before commit or rollback.

        Parameters:
        definition - Transaction definition to use
        Returns:
        Transaction facade
      • start

        public static io.toro.martini.transaction.TransactionFacade start()
        Creates a started TransactionFacade.

        Callers just need to invoke commit or rollback, without explicitly calling start.