Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.multi()


    2000, "foobared");

  Jedis jedis = pool.getResource();
  try {
      jedis.set("hello", "jedis");
      Transaction t = jedis.multi();
      t.set("hello", "world");
  } finally {
      jedis.close();
  }
View Full Code Here


        return incr;
    }

    public List<Object> multi(TransactionBlock transaction) {
        Jedis jedis = getResource();
        List<Object> multi = jedis.multi(transaction);
        returnResource(jedis);
        return multi;
    }

    public Long del() {
View Full Code Here

    protected CacheEntryDAO entryDao;

    public CacheEntry save(CacheEntry entry)
    {
        Jedis jedis = jedisPool.getResource();
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            entryDao.save(entry, transaction);
View Full Code Here

    }

    public void delete(CacheEntry entry)
    {
        Jedis jedis = jedisPool.getResource();
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            entryDao.delete(entry, transaction);
View Full Code Here

                jobsToInsert.add(job);
            }
        }

        // Save logic
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            // Persist not persisted Jobs
View Full Code Here

    }

    public void delete(final Task task)
    {
        Jedis jedis = jedisPool.getResource();
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            delete(task, transaction);
View Full Code Here

    }

    public void delete(final List<Task> tasks)
    {
        Jedis jedis = jedisPool.getResource();
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            for (Task task : tasks)
View Full Code Here

    }

    public Job save(final Job job)
    {
        Jedis jedis = jedisPool.getResource();
        Transaction transaction = jedis.multi();
        boolean discard = true;

        try
        {
            jobDao.save(job, transaction);
View Full Code Here

    public void trimOwnersTasks(final TaskOwnerType type, final long numberOfTasks)
    {
        Jedis jedis = jedisPool.getResource();
        Jedis jedisTx = jedisPool.getResource();
        Transaction transaction = jedisTx.multi();
        boolean discard = true;

        try
        {
            Set<String> owners = jedis.smembers(ownerIndexKey(type));
View Full Code Here

      return false;
    }

    try {
      // atomically remove ticket
      Transaction t = jedis.multi();
      t.del(key(repository, KeyType.ticket, ticket.number));
      t.del(key(repository, KeyType.journal, ticket.number));
      t.exec();

      success = true;
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.