use of org.redisson.RedissonLock in project redisson by redisson.
the class BucketGetAndDeleteOperation method commit.
@Override
public void commit(CommandAsyncExecutor commandExecutor) {
RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
bucket.getAndDeleteAsync();
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync(getThreadId());
}
use of org.redisson.RedissonLock in project redisson by redisson.
the class BucketSetOperation method commit.
@Override
public void commit(CommandAsyncExecutor commandExecutor) {
RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
if (timeToLive != 0) {
bucket.setAsync((V) value, timeToLive, timeUnit);
} else {
bucket.setAsync((V) value);
}
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync(getThreadId());
}
use of org.redisson.RedissonLock in project redisson by redisson.
the class BucketSetOperation method rollback.
@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync(getThreadId());
}
use of org.redisson.RedissonLock in project redisson by redisson.
the class DeleteOperation method rollback.
@Override
public void rollback(CommandAsyncExecutor commandExecutor) {
if (lockName != null) {
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync();
}
}
use of org.redisson.RedissonLock in project redisson by redisson.
the class DeleteOperation method commit.
@Override
public void commit(CommandAsyncExecutor commandExecutor) {
RKeys keys = new RedissonKeys(commandExecutor);
keys.deleteAsync(getName());
if (lockName != null) {
RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
lock.unlockAsync();
}
}
Aggregations