Package redis.clients.jedis

Examples of redis.clients.jedis.Transaction.sadd()


            }

            Transaction trans = conn.multi();
            trans.hincrBy(seller, "funds", (int)price);
            trans.hincrBy(buyer, "funds", (int)-price);
            trans.sadd(inventory, itemId);
            trans.zrem("market:", item);
            List<Object> results = trans.exec();
            // null response indicates that the transaction was aborted due to
            // the watched key changing.
            if (results == null){
View Full Code Here


            final String endpointToken = channel.getEndpointToken();
            final Transaction tx = jedis.multi();
            tx.set(endpointToken, Long.toString(channel.getVersion()));
            tx.set(tokenLookupKey(endpointToken), chid);
            tx.hmset(chidLookupKey(chid), mapOf(endpointToken, uaid));
            tx.sadd(uaidLookupKey(uaid), chid);
            tx.exec();
            return true;
        } finally {
            jedisPool.returnResource(jedis);
        }
View Full Code Here

            byte[] object = RedisSerializationUtil.encode((Serializable) value);
            transaction.set(attributeKey.getBytes(RedisSessionKeys.getEncoding()), object);
            transaction.expireAt(attributeKey.getBytes(RedisSessionKeys.getEncoding()), getUnixTime(currentExpireAtTimeWithReserve));

            transaction.sadd(attrsListKey, name);
            transaction.expireAt(attrsListKey, getUnixTime(currentExpireAtTimeWithReserve));

            transaction.exec();

            pool.returnResource(jedis);
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.