Replies: 1 comment 3 replies
-
You can create Transaction directly from the connection.
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want use PooledConnectionProvider + UnifiedJedis + Transaction but it throws exception, how can use this or is there any alternate way to use same
Code :
import java.time.Duration;
import org.apache.commons.pool2.PooledObjectFactory;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import redis.clients.jedis.Connection;
import redis.clients.jedis.ConnectionFactory;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisPooled;
import redis.clients.jedis.Transaction;
import redis.clients.jedis.UnifiedJedis;
import redis.clients.jedis.providers.PooledConnectionProvider;
public class TransactionTest {
private static final PooledConnectionProvider connectionProvider = buildPoolConfig();
}
Exception:
Exception in thread "main" java.lang.IllegalStateException: It is not allowed to create Pipeline from this class redis.clients.jedis.UnifiedJedis
at redis.clients.jedis.UnifiedJedis.multi(UnifiedJedis.java:4696)
at com.test.jedisTest.Jedis_Test.TransactionTest.test(TransactionTest.java:52)
at com.test.jedisTest.Jedis_Test.TransactionTest.main(TransactionTest.java:58)
Beta Was this translation helpful? Give feedback.
All reactions