Class DefaultTransactionStatus<T>

    • Constructor Detail

      • DefaultTransactionStatus

        public DefaultTransactionStatus​(@Nullable
                                        java.lang.Object transaction,
                                        java.util.function.Supplier<T> connectionSupplier,
                                        boolean newTransaction,
                                        boolean newSynchronization,
                                        boolean readOnly,
                                        boolean debug,
                                        java.lang.Object suspendedResources)
        Create a new DefaultTransactionStatus instance.
        transaction - underlying transaction object that can hold state for the internal transaction implementation
        connectionSupplier - The connection supplier
        newTransaction - if the transaction is new, otherwise participating in an existing transaction
        newSynchronization - if a new transaction synchronization has been opened for the given transaction
        readOnly - whether the transaction is marked as read-only
        debug - should debug logging be enabled for the handling of this transaction? Caching it in here can prevent repeated calls to ask the logging system whether debug logging should be enabled.
        suspendedResources - a holder for resources that have been suspended for this transaction, if any
    • Method Detail

      • getConnection

        public T getConnection()
        The associated connection.
      • getTransaction

        public java.lang.Object getTransaction()
        Return the underlying transaction object.
        The underlying transaction
        java.lang.IllegalStateException - if no transaction is active
      • hasTransaction

        public boolean hasTransaction()
        Return whether there is an actual transaction active.
        Does the status have a transaction
      • isNewTransaction

        public boolean isNewTransaction()
        Description copied from interface: TransactionExecution
        Return whether the present transaction is new; otherwise participating in an existing transaction, or potentially not running in an actual transaction in the first place.
        Whether the execution is a new transaction
      • isNewSynchronization

        public boolean isNewSynchronization()
        Return if a new transaction synchronization has been opened for this transaction.
        Is it a new synchronization
      • isReadOnly

        public boolean isReadOnly()
        Return if this transaction is defined as read-only transaction.
        Is the transaction read only
      • isDebug

        public boolean isDebug()
        Return whether the progress of this transaction is debugged. This is used by AbstractSynchronousTransactionManager as an optimization, to prevent repeated calls to logger.isDebugEnabled(). Not really intended for client code.
        Is debug enabled
      • getSuspendedResources

        public java.lang.Object getSuspendedResources()
        Return the holder for resources that have been suspended for this transaction, if any.
        The suspended resources
      • isTransactionSavepointManager

        public boolean isTransactionSavepointManager()
        Return whether the underlying transaction implements the SavepointManager interface and therefore supports savepoints.
        Is the transaction a save point manager
        See Also:
        getTransaction(), getSavepointManager()