Interface CallbackPreferringPlatformTransactionManager

    • Method Detail

      • execute

        <T> T execute(@Nullable
                                TransactionDefinition definition,
                                TransactionCallback<T> callback)
                         throws TransactionException
        Execute the action specified by the given callback object within a transaction.

        Allows for returning a result object created within the transaction, that is, a domain object or a collection of domain objects. A RuntimeException thrown by the callback is treated as a fatal exception that enforces a rollback. Such an exception gets propagated to the caller of the template.

        definition - the definition for the transaction to wrap the callback in
        callback - the callback object that specifies the transactional action
        a result object returned by the callback, or null if none
        TransactionException - in case of initialization, rollback, or system errors
        java.lang.RuntimeException - if thrown by the TransactionCallback