@@ -1457,6 +1457,11 @@ programming arrangements as the following listing shows:
1457
1457
}
1458
1458
----
1459
1459
1460
+ Note that there are special considerations for the returned `Publisher` with regards to
1461
+ Reactive Streams cancellation signals. See the <<tx-prog-operator-cancel>> section under
1462
+ "Using the TransactionOperator" for more details.
1463
+
1464
+
1460
1465
.Method visibility and `@Transactional`
1461
1466
****
1462
1467
When you use proxies, you should apply the `@Transactional` annotation only to methods
@@ -2446,6 +2451,21 @@ method on the supplied `ReactiveTransaction` object, as follows:
2446
2451
})
2447
2452
----
2448
2453
2454
+ [[tx-prog-operator-cancel]]
2455
+ ===== Cancel Signals
2456
+
2457
+ In Reactive Streams, a `Subscriber` can cancel its `Subscription` and terminate its
2458
+ `Publisher`. Operators in Project Reactor, as well as in other libraries, such as `next()`,
2459
+ `take(long)`, `timeout(Duration)`, and others can issue cancellations. There is no way to
2460
+ know the reason for the cancellation, whether it is due to an error or a simply lack of
2461
+ interest to consume further, and in version 5.2 the `TransactionalOperator` defaults to
2462
+ committing the transaction on cancel. In version 5.3 this behavior will change and
2463
+ transactions will be roll back on cancel to create a reliable and deterministic outcome.
2464
+ As a result it is important to consider the operators used downstream from a transaction
2465
+ `Publisher`. In particular in the case of a `Flux` or other multi-value `Publisher`,
2466
+ the full output must be consumed to allow the transaction to complete.
2467
+
2468
+
2449
2469
[[tx-prog-operator-settings]]
2450
2470
===== Specifying Transaction Settings
2451
2471
0 commit comments