com.scalar.db.transaction.consensuscommit.UncommittedRecordException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalardb Show documentation
Show all versions of scalardb Show documentation
A universal transaction manager that achieves database-agnostic transactions and distributed transactions that span multiple databases
package com.scalar.db.transaction.consensuscommit;
import com.google.common.collect.ImmutableList;
import com.scalar.db.exception.transaction.CrudConflictException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class UncommittedRecordException extends CrudConflictException {
private final List results;
public UncommittedRecordException(
TransactionResult result, String message, String transactionId) {
this(result, message, null, transactionId);
}
public UncommittedRecordException(
TransactionResult result, String message, Throwable cause, String transactionId) {
super(message, cause, transactionId);
results = Collections.singletonList(result);
}
public UncommittedRecordException(
List results, String message, String transactionId) {
this(results, message, null, transactionId);
}
public UncommittedRecordException(
List results, String message, Throwable cause, String transactionId) {
super(message, cause, transactionId);
this.results = new ArrayList<>();
this.results.addAll(results);
}
public List getResults() {
return ImmutableList.copyOf(results);
}
}