Package redis.clients.jedis

Examples of redis.clients.jedis.TransactionBlock


            throw new JOhmException(e);
        } catch (IllegalAccessException e) {
            throw new JOhmException(e);
        }

        nest.multi(new TransactionBlock() {
            public void execute() throws JedisException {
                del(nest.cat(JOhmUtils.getId(model)).key());
                hmset(nest.cat(JOhmUtils.getId(model)).key(), hashedObject);
            }
        });
View Full Code Here


            jedisExecutor.execute(new JedisCallback<Object>() {
                @Override
                public Object execute(Jedis jedis) {
                    session.lastSaved = System.currentTimeMillis();
                    toStore.put("lastSaved", "" + session.lastSaved);
                    return jedis.multi(new TransactionBlock() {
                        @Override
                        public void execute() throws JedisException {
                            final String key = RedisSessionIdManager.REDIS_SESSION_KEY + session.getClusterId();
                            super.hmset(key, toStore);
                            int ttl = session.getMaxInactiveInterval();
View Full Code Here

    protected List<String> scavenge(final List<String> clusterIds) {
        List<String> expired = new LinkedList<String>();
        List<Object> status = jedisExecutor.execute(new JedisCallback<List<Object>>() {
            @Override
            public List<Object> execute(Jedis jedis) {
                return jedis.multi(new TransactionBlock() {
                    @Override
                    public void execute() throws JedisException {
                        for (String clusterId : clusterIds) {
                            exists(REDIS_SESSION_KEY + clusterId);
                        }
View Full Code Here

      final Jedis j = pool.getResource();
      try {
        j.select(db);
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              mget(row + s, row + v, row + d);
            }
          });
View Full Code Here

          j.set(schemaKey + z, doc);
        }
        final String finalSchemaKey = schemaKey;
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              incr(row + v);
              mset(row + s, finalSchemaKey, row + d, new String(serialize(value), UTF8));
            }
View Full Code Here

            (versionStr != null && !versionStr.equals(String.valueOf(version))) // version in db doesn't match
            ) {
          return false;
        }
        final String finalSchemaKey = schemaKey;
        List<Object> results = j.multi(new TransactionBlock() {
          @Override
          public void execute() throws JedisException {
            mset(row + v, String.valueOf(version + 1), row + s, finalSchemaKey, row + d, new String(serialize(value), UTF8));
          }
        });
View Full Code Here

      Jedis j = pool.getResource();
      try {
        j.select(db);
        List<Object> results;
        do {
          results = j.multi(new TransactionBlock() {
            @Override
            public void execute() throws JedisException {
              del(row + v); // Delete the version first and it is deleted
              del(row + d);
              del(row + s);
View Full Code Here

TOP

Related Classes of redis.clients.jedis.TransactionBlock

Copyright © 2018 www.massapicom. 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.