Search in sources :

Example 1 with TransactionLockTimeoutException

use of com.palantir.atlasdb.transaction.api.TransactionLockTimeoutException in project atlasdb by palantir.

the class SnapshotTransaction method throwIfImmutableTsOrCommitLocksExpired.

private void throwIfImmutableTsOrCommitLocksExpired(@Nullable LockToken commitLocksToken) {
    Set<LockToken> expiredLocks = refreshCommitAndImmutableTsLocks(commitLocksToken);
    if (!expiredLocks.isEmpty()) {
        final String baseMsg = "Required locks are no longer valid. ";
        String expiredLocksErrorString = getExpiredLocksErrorString(commitLocksToken, expiredLocks);
        TransactionLockTimeoutException ex = new TransactionLockTimeoutException(baseMsg + expiredLocksErrorString);
        log.error(baseMsg + "{}", expiredLocksErrorString, ex);
        throw ex;
    }
}
Also used : TransactionLockTimeoutException(com.palantir.atlasdb.transaction.api.TransactionLockTimeoutException) LockToken(com.palantir.lock.v2.LockToken)

Aggregations

TransactionLockTimeoutException (com.palantir.atlasdb.transaction.api.TransactionLockTimeoutException)1 LockToken (com.palantir.lock.v2.LockToken)1