Package io.toro.martini.transaction
Class Transactions
- java.lang.Object
-
- io.toro.martini.transaction.Transactions
-
public final class Transactions extends Object
Provides utility methods for managing Transactions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.toro.martini.transaction.TransactionFacade
create()
Creates an unstartedTransactionFacade
.static io.toro.martini.transaction.TransactionFacade
create(int timeout)
static io.toro.martini.transaction.TransactionFacade
create(String name)
static io.toro.martini.transaction.TransactionFacade
create(String name, String propagationBehavior)
static io.toro.martini.transaction.TransactionFacade
create(String name, String propagationBehavior, int timeout)
(package private) static io.toro.martini.transaction.TransactionFacade
create(PlatformTransactionManager txManager, int timeout)
static io.toro.martini.transaction.TransactionFacade
create(TransactionDefinition definition)
Creates an unstartedTransactionFacade
.static io.toro.martini.transaction.TransactionDefinitionBuilder
define()
Returns a builder instance for buildingTransactionDefinition
s.static io.toro.martini.transaction.TransactionFacade
start()
Creates a startedTransactionFacade
.
-
-
-
Method Detail
-
create
static io.toro.martini.transaction.TransactionFacade create(PlatformTransactionManager txManager, int timeout)
-
create
public static io.toro.martini.transaction.TransactionFacade create()
Creates an unstartedTransactionFacade
.Callers must specifically invoke
start
first beforecommit
orrollback
.- 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 namepropagationBehavior
- Transaction propagation behavior. Possible values are:PROPAGATION_REQUIRED
,PROPAGATION_SUPPORTS
,PROPAGATION_MANDATORY
,PROPAGATION_REQUIRES_NEW
PROPAGATION_NOT_SUPPORTED
,PROPAGATION_NEVER
,PROPAGATION_NESTED
, ANDPROPAGATION_DEFAULT
.
-
create
public static io.toro.martini.transaction.TransactionFacade create(String name, String propagationBehavior, int timeout)
- Parameters:
name
- Transaction namepropagationBehavior
- Transaction propagation behavior. Possible values are:PROPAGATION_REQUIRED
,PROPAGATION_SUPPORTS
,PROPAGATION_MANDATORY
,PROPAGATION_REQUIRES_NEW
PROPAGATION_NOT_SUPPORTED
,PROPAGATION_NEVER
,PROPAGATION_NESTED
, ANDPROPAGATION_DEFAULT
. * @param timeout Transactiontimeout
- Transaction timeout
-
create
public static io.toro.martini.transaction.TransactionFacade create(TransactionDefinition definition)
Creates an unstartedTransactionFacade
.Callers must specifically invoke
start
first beforecommit
orrollback
.- Parameters:
definition
- Transaction definition to use- Returns:
- Transaction facade
-
start
public static io.toro.martini.transaction.TransactionFacade start()
Creates a startedTransactionFacade
.Callers just need to invoke
commit
orrollback
, without explicitly callingstart
.
-
define
public static io.toro.martini.transaction.TransactionDefinitionBuilder define()
Returns a builder instance for buildingTransactionDefinition
s.
-
-