use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.
the class BucketTrySetOperation method commit.
@Override
public void commit(CommandAsyncExecutor commandExecutor) {
RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
if (timeToLive != 0) {
bucket.trySetAsync((V) value, timeToLive, timeUnit);
} else {
bucket.trySetAsync((V) value);
}
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync(getThreadId());
}
use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.
the class BucketGetAndDeleteOperation method rollback.
@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync(getThreadId());
}
use of org.redisson.transaction.RedissonTransactionalLock in project redisson by redisson.
the class BucketsTrySetOperation method unlock.
protected void unlock(CommandAsyncExecutor commandExecutor) {
for (String key : values.keySet()) {
RLock lock = new RedissonTransactionalLock(commandExecutor, getLockName(key), transactionId);
lock.unlockAsync();
}
}
Aggregations