Search in sources :

Example 6 with RedissonTransactionalLock

use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.

the class BucketTrySetOperation method rollback.

@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock)

Example 7 with RedissonTransactionalLock

use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.

the class BucketCompareAndSetOperation method rollback.

@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock)

Example 8 with RedissonTransactionalLock

use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.

the class BucketCompareAndSetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    bucket.compareAndSetAsync(expected, value);
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Example 9 with RedissonTransactionalLock

use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.

the class BucketGetAndSetOperation method rollback.

@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock)

Example 10 with RedissonTransactionalLock

use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.

the class BucketGetAndSetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    if (timeToLive != 0) {
        bucket.getAndSetAsync((V) value, timeToLive, timeUnit);
    } else {
        bucket.getAndSetAsync((V) value);
    }
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Aggregations

RedissonTransactionalLock (org.redisson.transaction.RedissonTransactionalLock)13 RedissonLock (org.redisson.RedissonLock)12 RedissonBucket (org.redisson.RedissonBucket)5 RedissonKeys (org.redisson.RedissonKeys)1 RKeys (org.redisson.api.RKeys)1 RLock (org.redisson.api.RLock)1