Merge pull request #29048 from 1993heqiang

* pr/29048:
  Fix typo in data-access section

Closes gh-29048
This commit is contained in:
Stephane Nicoll 2022-09-05 07:23:55 +02:00
commit 8dcb2a75fa
1 changed files with 7 additions and 7 deletions

View File

@ -1520,7 +1520,7 @@ programming arrangements as the following listing shows:
Note that there are special considerations for the returned `Publisher` with regards to Note that there are special considerations for the returned `Publisher` with regards to
Reactive Streams cancellation signals. See the <<tx-prog-operator-cancel>> section under Reactive Streams cancellation signals. See the <<tx-prog-operator-cancel>> section under
"Using the TransactionOperator" for more details. "Using the TransactionalOperator" for more details.
[[transaction-declarative-annotations-method-visibility]] [[transaction-declarative-annotations-method-visibility]]
@ -2474,32 +2474,32 @@ different settings (for example, a different isolation level), you need to creat
two distinct `TransactionTemplate` instances. two distinct `TransactionTemplate` instances.
[[tx-prog-operator]] [[tx-prog-operator]]
==== Using the `TransactionOperator` ==== Using the `TransactionalOperator`
The `TransactionOperator` follows an operator design that is similar to other reactive The `TransactionalOperator` follows an operator design that is similar to other reactive
operators. It uses a callback approach (to free application code from having to do the operators. It uses a callback approach (to free application code from having to do the
boilerplate acquisition and release transactional resources) and results in code that is boilerplate acquisition and release transactional resources) and results in code that is
intention driven, in that your code focuses solely on what you want to do. intention driven, in that your code focuses solely on what you want to do.
NOTE: As the examples that follow show, using the `TransactionOperator` absolutely NOTE: As the examples that follow show, using the `TransactionalOperator` absolutely
couples you to Spring's transaction infrastructure and APIs. Whether or not programmatic couples you to Spring's transaction infrastructure and APIs. Whether or not programmatic
transaction management is suitable for your development needs is a decision that you have transaction management is suitable for your development needs is a decision that you have
to make yourself. to make yourself.
Application code that must run in a transactional context and that explicitly uses Application code that must run in a transactional context and that explicitly uses
the `TransactionOperator` resembles the next example: the `TransactionalOperator` resembles the next example:
[source,java,indent=0,subs="verbatim,quotes",role="primary"] [source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java .Java
---- ----
public class SimpleService implements Service { public class SimpleService implements Service {
// single TransactionOperator shared amongst all methods in this instance // single TransactionalOperator shared amongst all methods in this instance
private final TransactionalOperator transactionalOperator; private final TransactionalOperator transactionalOperator;
// use constructor-injection to supply the ReactiveTransactionManager // use constructor-injection to supply the ReactiveTransactionManager
public SimpleService(ReactiveTransactionManager transactionManager) { public SimpleService(ReactiveTransactionManager transactionManager) {
this.transactionOperator = TransactionalOperator.create(transactionManager); this.transactionalOperator = TransactionalOperator.create(transactionManager);
} }
public Mono<Object> someServiceMethod() { public Mono<Object> someServiceMethod() {