public class ChainedTransactionManager extends Object implements PlatformTransactionManager
org.springframework.transaction.PlatformTransactionManager implementation that orchestrates transaction creation, commits and rollbacks to a list of delegates. Using this implementation assumes that errors causing a transaction rollback will usually happen before the transaction completion or during the commit of the most inner org.springframework.transaction.PlatformTransactionManager.
The configured instances will start transactions in the order given and commit/rollback in reverse order, which means the org.springframework.transaction.PlatformTransactionManager most likely to break the transaction should be the last in the list configured. A org.springframework.transaction.PlatformTransactionManager throwing an exception during commit will automatically cause the remaining transaction managers to roll back instead of committing. original source: org.springframework.data.transaction.ChainedTransactionManagerConstructor and description |
---|
ChainedTransactionManager(PlatformTransactionManager transactionManagers) Creates a new ChainedTransactionManager delegating to the given PlatformTransactionManagers. |
Type Params | Return Type | Name and description |
---|---|---|
|
protected boolean |
canCreateTransaction(TransactionDefinition definition) |
|
public void |
commit(TransactionStatus status) |
|
public MultiTransactionStatus |
getTransaction(TransactionDefinition definition) |
|
public List<PlatformTransactionManager> |
getTransactionManagers() |
|
public void |
rollback(TransactionStatus status) |
Creates a new ChainedTransactionManager delegating to the given PlatformTransactionManagers.
transactionManagers
- must not be null or empty.