You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a connection is lost before a command is completed, the command will fail with a `JedisConnectionException`. Although the connection pool manages the connections
375
+
for you, you must request a new connection from the pool to retry the command.
376
+
You would typically do this in a loop that makes several attempts to reconnect
377
+
before aborting and reporting that the error isn't transient. The example below
@@ -51,6 +52,13 @@ write your own code to cache and reuse open connections. See
51
52
[Connect with a connection pool]({{< relref "/develop/clients/jedis/connect#connect-with-a-connection-pool" >}})
52
53
to learn how to use this technique with Jedis.
53
54
55
+
### Connection retries
56
+
57
+
If a connection is lost before a command is completed, the command will fail with a `JedisConnectionException`. However, a connection error is often transient, in which case the
58
+
command will succeed after one or more reconnection attempts. See
59
+
[Retrying a command after a connection failure]({{< relref "/develop/clients/jedis/connect#retrying-a-command-after-a-connection-failure" >}})
60
+
for an example of a simple retry loop that can recover from a transient connection error.
0 commit comments