ChainedTransactionManager (Grails 6.0.0)

Package: org.grails.transaction

## [Java] Class ChainedTransactionManager

- org.grails.transaction.ChainedTransactionManager

- All Implemented Interfaces and Traits:
    org.springframework.transaction.PlatformTransactionManager

      public class ChainedTransactionManager
      extends java.lang.Object
      implements org.springframework.transaction.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: https://github.com/spring-projects/spring-data-commons/blob/master/src/main/java/org/springframework/data/transaction/ChainedTransactionManager.java
  Authors:
    Michael Hunger
    Oliver Gierke
    Lari Hotari
    Graeme Rocher
  Since:
    2.3.6

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static org.slf4j.Logger` | `LOGGER` |
    `private SynchronizationManager` | `synchronizationManager` |
    `private java.util.List<org.springframework.transaction.PlatformTransactionManager>` | `transactionManagers` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ChainedTransactionManager (org.springframework.transaction.PlatformTransactionManager transactionManagers)` Creates a new ChainedTransactionManager delegating to the given org.springframework.transaction.PlatformTransactionManagers.
    `ChainedTransactionManager (SynchronizationManager synchronizationManager, org.springframework.transaction.PlatformTransactionManager transactionManagers)` Creates a new ChainedTransactionManager using the given SynchronizationManager and org.springframework.transaction.PlatformTransactionManagers.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected boolean` | `canCreateTransaction(org.springframework.transaction.TransactionDefinition definition)`
    `` | `public void` | `commit(org.springframework.transaction.TransactionStatus status)`
    `` | `private org.springframework.transaction.PlatformTransactionManager` | `getLastTransactionManager()`
    `` | `public MultiTransactionStatus` | `getTransaction(org.springframework.transaction.TransactionDefinition definition)`
    `` | `public java.util.List<org.springframework.transaction.PlatformTransactionManager>` | `getTransactionManagers()`
    `` | `private int` | `lastTransactionManagerIndex()`
    `<T>` | `private java.lang.Iterable<T>` | `reverse(java.util.Collection<T> collection)`
    `` | `public void` | `rollback(org.springframework.transaction.TransactionStatus status)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private static final org.slf4j.Logger LOGGER

    - #### private final SynchronizationManager synchronizationManager

    - #### private final java.util.List<org.springframework.transaction.PlatformTransactionManager> transactionManagers

  - ### Constructor Detail

    - #### public ChainedTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManagers)

      Creates a new ChainedTransactionManager delegating to the given org.springframework.transaction.PlatformTransactionManagers.

      Parameters:
        `transactionManagers` - must not be null or empty.

    - #### ChainedTransactionManager(SynchronizationManager synchronizationManager, org.springframework.transaction.PlatformTransactionManager transactionManagers)

      Creates a new ChainedTransactionManager using the given SynchronizationManager and org.springframework.transaction.PlatformTransactionManagers.

      Parameters:
        `synchronizationManager` - must not be null.
        `transactionManagers` - must not be null or empty.

  - ### Method Detail

    - #### protected boolean canCreateTransaction(org.springframework.transaction.TransactionDefinition definition)

    - #### public void commit(org.springframework.transaction.TransactionStatus status)

    - #### private org.springframework.transaction.PlatformTransactionManager getLastTransactionManager()

    - #### public MultiTransactionStatus getTransaction(org.springframework.transaction.TransactionDefinition definition)

    - #### public java.util.List<org.springframework.transaction.PlatformTransactionManager> getTransactionManagers()

    - #### private int lastTransactionManagerIndex()

    - #### <T> private java.lang.Iterable<T> reverse(java.util.Collection<T> collection)

    - #### public void rollback(org.springframework.transaction.TransactionStatus status)