use of software.amazon.awssdk.services.dynamodb.model.TransactionConflictException in project scalardb by scalar-labs.
the class PutStatementHandler method handle.
@Nonnull
@Override
public List<Map<String, AttributeValue>> handle(Operation operation) throws ExecutionException {
checkArgument(operation, Put.class);
Put put = (Put) operation;
TableMetadata tableMetadata = metadataManager.getTableMetadata(operation);
try {
execute(put, tableMetadata);
} catch (ConditionalCheckFailedException e) {
throw new NoMutationException("no mutation was applied.", e);
} catch (TransactionConflictException e) {
throw new RetriableExecutionException(e.getMessage(), e);
} catch (DynamoDbException e) {
throw new ExecutionException(e.getMessage(), e);
}
return Collections.emptyList();
}
use of software.amazon.awssdk.services.dynamodb.model.TransactionConflictException in project scalardb by scalar-labs.
the class DeleteStatementHandler method handle.
@Nonnull
@Override
public List<Map<String, AttributeValue>> handle(Operation operation) throws ExecutionException {
checkArgument(operation, Delete.class);
Delete delete = (Delete) operation;
TableMetadata tableMetadata = metadataManager.getTableMetadata(operation);
try {
delete(delete, tableMetadata);
} catch (ConditionalCheckFailedException e) {
throw new NoMutationException("no mutation was applied.", e);
} catch (TransactionConflictException e) {
throw new RetriableExecutionException(e.getMessage(), e);
} catch (DynamoDbException e) {
throw new ExecutionException(e.getMessage(), e);
}
return Collections.emptyList();
}
Aggregations