I'm using jedis client to interact with the Redis database. I'm using the code like the following as mentioned here in the docs. I'm reusing the jedisPooled repeatedly in various places to add keys and values. I want to know whether the following method is thread-safe or not.
import redis.clients.jedis.JedisPooled
val jedisPooled = JedisPooled("localhost", 6379);
jedisPooled.set("enabled","true)
It is mentioned here that connection pools are thread-safe. But I encounter exceptions like
java.net.SocketException
as mentioned here. I would appreciate it very much if someone could tell me what am I doing wrong?