From 27987b4e1f929452689e53b1778a5d5b284919eb Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 14 Mar 2024 15:02:51 +0100 Subject: [PATCH] Polishing. Tweak wording. See #2865 Original pull request: #2870 --- .../antora/modules/ROOT/pages/redis/transactions.adoc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/redis/transactions.adoc b/src/main/antora/modules/ROOT/pages/redis/transactions.adoc index ee823b946..de48a55cc 100644 --- a/src/main/antora/modules/ROOT/pages/redis/transactions.adoc +++ b/src/main/antora/modules/ROOT/pages/redis/transactions.adoc @@ -25,9 +25,8 @@ System.out.println("Number of items added to set: " + txResults.get(0)); `RedisTemplate` uses its value, hash key, and hash value serializers to deserialize all results of `exec` before returning. There is an additional `exec` method that lets you pass a custom serializer for transaction results. -It is worth mentioning that if between the commands multi() and exec() a query timeout exception happens (e.g. in case -Redis is not available to respond fast) then the connection may get stuck in a transactional state. To prevent -such situation you have to control the transaction state: +It is worth mentioning that in case between `multi()` and `exec()` an exception happens (e.g. a timeout exception in case Redis does not respond within the timeout) then the connection may get stuck in a transactional state. +To prevent such a situation need have to discard the transactional state to clear the connection: [source,java] ---- @@ -40,11 +39,9 @@ List txResults = redisOperations.execute(new SessionCallback