public class ChainedTransactionManager extends Object implements org.springframework.transaction.PlatformTransactionManager
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 PlatformTransactionManager.
The configured instances will start transactions in the order given and commit/rollback in reverse order,
which means the PlatformTransactionManager most likely to break the transaction should be the last
in the list configured. A PlatformTransactionManager throwing an exception during commit will automatically
cause the remaining transaction managers to roll back instead of committing.| Constructor and Description |
|---|
ChainedTransactionManager(org.springframework.transaction.PlatformTransactionManager... transactionManagers)
Creates a new
ChainedTransactionManager delegating to the given PlatformTransactionManagers. |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(org.springframework.transaction.TransactionStatus status) |
org.springframework.data.transaction.MultiTransactionStatus |
getTransaction(org.springframework.transaction.TransactionDefinition definition) |
void |
rollback(org.springframework.transaction.TransactionStatus status) |
public ChainedTransactionManager(org.springframework.transaction.PlatformTransactionManager... transactionManagers)
ChainedTransactionManager delegating to the given PlatformTransactionManagers.transactionManagers - must not be null or empty.public org.springframework.data.transaction.MultiTransactionStatus getTransaction(org.springframework.transaction.TransactionDefinition definition)
throws org.springframework.transaction.TransactionException
getTransaction in interface org.springframework.transaction.PlatformTransactionManagerorg.springframework.transaction.TransactionExceptionpublic void commit(org.springframework.transaction.TransactionStatus status)
throws org.springframework.transaction.TransactionException
commit in interface org.springframework.transaction.PlatformTransactionManagerorg.springframework.transaction.TransactionExceptionpublic void rollback(org.springframework.transaction.TransactionStatus status)
throws org.springframework.transaction.TransactionException
rollback in interface org.springframework.transaction.PlatformTransactionManagerorg.springframework.transaction.TransactionExceptionCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.