All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yandex.ydb.table.transaction.Transaction Maven / Gradle / Ivy

There is a newer version: 1.45.6
Show newest version
package com.yandex.ydb.table.transaction;

import java.util.concurrent.CompletableFuture;

import com.yandex.ydb.core.Status;
import com.yandex.ydb.table.settings.CommitTxSettings;
import com.yandex.ydb.table.settings.RollbackTxSettings;


/**
 * @author Sergey Polovko
 */
public interface Transaction {

    String getId();

    default boolean isActive() {
        return !getId().isEmpty();
    }

    CompletableFuture commit(CommitTxSettings settings);

    default CompletableFuture commit() {
        return commit(new CommitTxSettings());
    }

    CompletableFuture rollback(RollbackTxSettings settings);

    default CompletableFuture rollback() {
        return rollback(new RollbackTxSettings());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy