Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.RedisConnection.ping()


    RedisConnection connection = factory2.getConnection();
    // Use the connection to make sure the channel is initialized, else nothing happens on close
    connection.ping();
    connection.close();
    // The dedicated connection should not be closed
    connection.ping();

    connection.close();
    factory2.destroy();
    pool.destroy();
  }
View Full Code Here


    LettuceConnectionFactory factory2 = new LettuceConnectionFactory(SettingsUtils.getHost(), SettingsUtils.getPort());
    factory2.setShareNativeConnection(false);
    factory2.afterPropertiesSet();
    RedisConnection connection = factory2.getConnection();
    // Use the connection to make sure the channel is initialized, else nothing happens on close
    connection.ping();
    connection.close();
    // The dedicated connection should be closed
    try {
      connection.set("foo".getBytes(), "bar".getBytes());
      fail("Exception should be thrown trying to use a closed connection");
View Full Code Here

    LettuceConnectionFactory factory2 = new LettuceConnectionFactory(pool);
    factory2.setShareNativeConnection(false);
    factory2.afterPropertiesSet();
    RedisConnection connection = factory2.getConnection();
    // Use the connection to make sure the channel is initialized, else nothing happens on close
    connection.ping();
    ((RedisAsyncConnection) connection.getNativeConnection()).close();
    try {
      connection.ping();
      fail("Exception should be thrown trying to use a closed connection");
    } catch (RedisSystemException e) {}
View Full Code Here

    RedisConnection connection = factory2.getConnection();
    // Use the connection to make sure the channel is initialized, else nothing happens on close
    connection.ping();
    ((RedisAsyncConnection) connection.getNativeConnection()).close();
    try {
      connection.ping();
      fail("Exception should be thrown trying to use a closed connection");
    } catch (RedisSystemException e) {}
    connection.close();
    factory2.destroy();
    pool.destroy();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.