Class TransactionDataImpl<T extends TransactionData>

  • All Implemented Interfaces:
    TransactionData

    public class TransactionDataImpl<T extends TransactionData>
    extends Object
    implements TransactionData
    Hold data accumulated during a transaction which we want to persist just prior to commit. Because multiple datasources could be involved in a distributed transaction, we need to hold TransactionData for each. Note that because all of this relates to a single transaction, this also means that it's a single thread, so there are no concurrency issues.
    • Constructor Detail

      • TransactionDataImpl

        public TransactionDataImpl​(Function<String,​T> mappingFunction)
        Public constructor
        Parameters:
        mappingFunction - Function to create new TransactionData instances if they don't yet exist
    • Method Detail

      • persist

        public void persist()
        Description copied from interface: TransactionData
        Persist the data. Don't propagate any exceptions. If an exception occurs, log the error and mark the transaction for rollback.
        Specified by:
        persist in interface TransactionData
      • findOrCreate

        public T findOrCreate​(String datasourceName)
        Get the TransactionData for the given datasourceName, creating a new instance one currently doesn't exist
        Parameters:
        datasourceName -
        Returns: