public class TransactionSupport extends Object
Constructor and Description |
---|
TransactionSupport() |
Modifier and Type | Method and Description |
---|---|
static Transaction |
current()
Returns current transaction
|
static <T> T |
executeInNewTransaction(TransactionMethod<T> code)
Forces "REQUIRES_NEW" and executes given code in that scope
|
static <T> T |
executeInScope(TransactionScopeOption scope,
TransactionMethod<T> code)
Runs given code in a given transaction scope
|
static void |
registerRollbackHandler(RollbackHandler rollbackHandler)
Attaches rollback handler to current transaction
|
static void |
resume(Transaction transaction)
Resumes given transaction
|
static void |
setRollbackOnly()
Marks the transaction for forced rollback.
|
static Transaction |
suspend()
Suspends and returns current transaction
|
public static Transaction suspend()
public static void resume(Transaction transaction)
public static Transaction current()
public static void registerRollbackHandler(RollbackHandler rollbackHandler)
public static <T> T executeInScope(TransactionScopeOption scope, TransactionMethod<T> code)
public static <T> T executeInNewTransaction(TransactionMethod<T> code)
public static void setRollbackOnly()
Copyright © 2012. All Rights Reserved.