com.yandex.ydb.table.transaction.Transaction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
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());
}
}