Skip to content

Commit

Permalink
Remove legacy config options from AbstractReactiveTransactionManager
Browse files Browse the repository at this point in the history
Includes general revision of reactive transaction sources.

See gh-22646
  • Loading branch information
jhoeller committed May 2, 2019
1 parent beea83b commit b5e5e33
Show file tree
Hide file tree
Showing 19 changed files with 385 additions and 979 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -18,15 +18,14 @@

import reactor.core.publisher.Mono;

import org.springframework.lang.Nullable;

/**
* This is the central interface in Spring's reactive transaction infrastructure.
* Applications can use this directly, but it is not primarily meant as API:
* Typically, applications will work with either transactional operators or
* declarative transaction demarcation through AOP.
*
* @author Mark Paluch
* @author Juergen Hoeller
* @since 5.2
* @see org.springframework.transaction.interceptor.TransactionProxyFactoryBean
*/
Expand All @@ -43,7 +42,7 @@ public interface ReactiveTransactionManager {
* <p>An exception to the above rule is the read-only flag, which should be
* ignored if no explicit read-only mode is supported. Essentially, the
* read-only flag is just a hint for potential optimization.
* @param definition the TransactionDefinition instance (can be empty for defaults),
* @param definition the TransactionDefinition instance,
* describing propagation behavior, isolation level, timeout etc.
* @return transaction status object representing the new or current transaction
* @throws TransactionException in case of lookup, creation, or system errors
Expand All @@ -55,7 +54,7 @@ public interface ReactiveTransactionManager {
* @see TransactionDefinition#getTimeout
* @see TransactionDefinition#isReadOnly
*/
Mono<ReactiveTransactionStatus> getTransaction(@Nullable TransactionDefinition definition) throws TransactionException;
Mono<ReactiveTransactionStatus> getTransaction(TransactionDefinition definition) throws TransactionException;

/**
* Commit the given transaction, with regard to its status. If the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,8 +16,6 @@

package org.springframework.transaction;

import reactor.core.publisher.Mono;

/**
* Representation of the status of a transaction exposing a reactive
* interface.
Expand All @@ -27,6 +25,7 @@
* an exception that causes an implicit rollback).
*
* @author Mark Paluch
* @author Juergen Hoeller
* @since 5.2
* @see #setRollbackOnly()
* @see ReactiveTransactionManager#getTransaction
Expand All @@ -45,10 +44,10 @@ public interface ReactiveTransactionStatus {
* that the only possible outcome of the transaction may be a rollback, as
* alternative to throwing an exception which would in turn trigger a rollback.
* <p>This is mainly intended for transactions managed by
* {@link org.springframework.transaction.reactive.support.TransactionalOperator} or
* {@link org.springframework.transaction.interceptor.ReactiveTransactionInterceptor},
* {@link org.springframework.transaction.reactive.TransactionalOperator} or
* {@link org.springframework.transaction.interceptor.TransactionInterceptor},
* where the actual commit/rollback decision is made by the container.
* @see org.springframework.transaction.reactive.support.ReactiveTransactionCallback#doInTransaction
* @see org.springframework.transaction.reactive.ReactiveTransactionCallback#doInTransaction
* @see org.springframework.transaction.interceptor.TransactionAttribute#rollbackOn
*/
void setRollbackOnly();
Expand All @@ -59,20 +58,12 @@ public interface ReactiveTransactionStatus {
*/
boolean isRollbackOnly();

/**
* Flush the underlying session to the datastore, if applicable.
* <p>This is effectively just a hint and may be a no-op if the underlying
* transaction manager does not have a flush concept. A flush signal may
* get applied to the primary resource or to transaction synchronizations,
* depending on the underlying resource.
*/
Mono<Void> flush();

/**
* Return whether this transaction is completed, that is,
* whether it has already been committed or rolled back.
* @see ReactiveTransactionManager#commit
* @see ReactiveTransactionManager#rollback
*/
boolean isCompleted();

}
Loading

0 comments on commit b5e5e33

Please sign in to comment.