Package redis.clients.jedis

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


            if (state == null) {
                tr.hdel(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
            } else {
                tr.hset(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE, state.name());
            }
            List<Object> resp = tr.exec();
            if (resp == null) {
                throw new SetFailedException();
            }
        } catch(JedisException e) {
            brokenJedis = true;
View Full Code Here


            tr.set(redisKey, "Y");
            tr.expire(redisKey, exp); //expire after exp seconds
            // since we have called watch, tr.exec will return null in the case that someone else has modified
            // the redisKey since we started our transaction.  If it doesn't return null, the value hasn't changed out from
            // under us, so we return true since we set it
            List<Object> resp = tr.exec();
            return resp != null;
        } catch (JedisException e) {
            brokenJedis = true;
            throw e;
        } finally {
View Full Code Here

            transaction.expireAt(attributeKey.getBytes(RedisSessionKeys.getEncoding()), getUnixTime(currentExpireAtTimeWithReserve));

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

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

            if (!disableListeners) {
                transaction.publish(RedisSessionKeys.getSessionChannel(), message);
            }

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

            transaction.expireAt(expiresAtKey, getUnixTime(expireAtTimeWithReserve));
            transaction.expireAt(timeoutKey, getUnixTime(expireAtTimeWithReserve));

            transaction.zadd(sessionsKey, currentTime, id);

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

            }

            transaction.zadd(RedisSessionKeys.getSessionsKey(), lastAccessTime, id);
            transaction.zrem(RedisSessionKeys.getSessionsKey(), this.id);

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

            transaction.set(lastAccessTimeKey, Long.toString(currentTime));
            transaction.expireAt(lastAccessTimeKey, getUnixTime(expireAtTime));

            transaction.zadd(RedisSessionKeys.getSessionsKey(), currentTime, id);

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

                String message = new String(Base64Util.encode(bytes));

                transaction.publish(RedisSessionKeys.getSessionChannel(), message);
            }

            transaction.exec();

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
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.