@ProviderType public interface TransactionStarter
Modifier and Type | Method and Description |
---|---|
<T> T |
notSupported(Callable<T> work)
The supplied piece of work must be run outside the context of a
transaction.
|
<T> T |
required(Callable<T> work)
A transaction is required to run the supplied piece of work.
|
<T> T |
requiresNew(Callable<T> work)
A new transaction is required to run the supplied piece of work.
|
<T> T |
supports(Callable<T> work)
The supplied piece of work may run inside or outside the context of a
transaction.
|
<T> T required(Callable<T> work) throws TransactionException, TransactionRolledBackException, ScopedWorkException
work
- TransactionException
- if there is an error starting or completing
the transactionTransactionRolledBackException
- if the transaction rolled back due
to a failure in one of the resources or an internal error in
the TransactionControl serviceScopedWorkException
- if the supplied work throws an
Exception
<T> T requiresNew(Callable<T> work) throws TransactionException, TransactionRolledBackException, ScopedWorkException
work
- TransactionException
- if there is an error starting or completing
the transactionTransactionRolledBackException
- if the transaction rolled back due
to a failureScopedWorkException
- if the supplied work throws an
Exception
<T> T notSupported(Callable<T> work) throws TransactionException, ScopedWorkException
The "no transaction" context does not support resource enlistment, and will not commit or rollback any changes, however it does provide a post completion callback to any registered functions. This function is suitable for final cleanup, such as closing a connection
work
- TransactionException
- if there is an error starting or completing
the transactionScopedWorkException
- if the supplied work throws an
Exception
<T> T supports(Callable<T> work) throws TransactionException, ScopedWorkException
The "no transaction" context does not support resource enlistment, and will not commit or rollback any changes, however it does provide a post completion callback to any registered functions. This function is suitable for final cleanup, such as closing a connection
work
- TransactionException
- if there is an error starting or completing
the transactionScopedWorkException
- if the supplied work throws an
Exception
Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0