Skip to content

Commit b5e5e33

Browse files
committed
Remove legacy config options from AbstractReactiveTransactionManager
Includes general revision of reactive transaction sources. See gh-22646
1 parent beea83b commit b5e5e33

19 files changed

+385
-979
lines changed

spring-tx/src/main/java/org/springframework/transaction/ReactiveTransactionManager.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,15 +18,14 @@
1818

1919
import reactor.core.publisher.Mono;
2020

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

6059
/**
6160
* Commit the given transaction, with regard to its status. If the transaction

spring-tx/src/main/java/org/springframework/transaction/ReactiveTransactionStatus.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.transaction;
1818

19-
import reactor.core.publisher.Mono;
20-
2119
/**
2220
* Representation of the status of a transaction exposing a reactive
2321
* interface.
@@ -27,6 +25,7 @@
2725
* an exception that causes an implicit rollback).
2826
*
2927
* @author Mark Paluch
28+
* @author Juergen Hoeller
3029
* @since 5.2
3130
* @see #setRollbackOnly()
3231
* @see ReactiveTransactionManager#getTransaction
@@ -45,10 +44,10 @@ public interface ReactiveTransactionStatus {
4544
* that the only possible outcome of the transaction may be a rollback, as
4645
* alternative to throwing an exception which would in turn trigger a rollback.
4746
* <p>This is mainly intended for transactions managed by
48-
* {@link org.springframework.transaction.reactive.support.TransactionalOperator} or
49-
* {@link org.springframework.transaction.interceptor.ReactiveTransactionInterceptor},
47+
* {@link org.springframework.transaction.reactive.TransactionalOperator} or
48+
* {@link org.springframework.transaction.interceptor.TransactionInterceptor},
5049
* where the actual commit/rollback decision is made by the container.
51-
* @see org.springframework.transaction.reactive.support.ReactiveTransactionCallback#doInTransaction
50+
* @see org.springframework.transaction.reactive.ReactiveTransactionCallback#doInTransaction
5251
* @see org.springframework.transaction.interceptor.TransactionAttribute#rollbackOn
5352
*/
5453
void setRollbackOnly();
@@ -59,20 +58,12 @@ public interface ReactiveTransactionStatus {
5958
*/
6059
boolean isRollbackOnly();
6160

62-
/**
63-
* Flush the underlying session to the datastore, if applicable.
64-
* <p>This is effectively just a hint and may be a no-op if the underlying
65-
* transaction manager does not have a flush concept. A flush signal may
66-
* get applied to the primary resource or to transaction synchronizations,
67-
* depending on the underlying resource.
68-
*/
69-
Mono<Void> flush();
70-
7161
/**
7262
* Return whether this transaction is completed, that is,
7363
* whether it has already been committed or rolled back.
7464
* @see ReactiveTransactionManager#commit
7565
* @see ReactiveTransactionManager#rollback
7666
*/
7767
boolean isCompleted();
68+
7869
}

0 commit comments

Comments
 (0)