@ThreadSafe public class GrpcTransactionManager extends AbstractDistributedTransactionManager
Constructor and Description |
---|
GrpcTransactionManager(DatabaseConfig databaseConfig) |
Modifier and Type | Method and Description |
---|---|
TransactionState |
abort(java.lang.String txId)
Aborts a given transaction.
|
void |
close()
Closes connections to the cluster.
|
TransactionState |
getState(java.lang.String txId)
Returns the state of a given transaction.
|
GrpcTransaction |
start()
Starts a new transaction.
|
GrpcTransaction |
start(Isolation isolation)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
GrpcTransaction |
start(Isolation isolation,
SerializableStrategy strategy)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
GrpcTransaction |
start(SerializableStrategy strategy)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
GrpcTransaction |
start(java.lang.String txId)
Starts a new transaction with the specified transaction ID.
|
GrpcTransaction |
start(java.lang.String txId,
Isolation isolation)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
GrpcTransaction |
start(java.lang.String txId,
Isolation isolation,
SerializableStrategy strategy)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
GrpcTransaction |
start(java.lang.String txId,
SerializableStrategy strategy)
Deprecated.
As of release 2.4.0. Will be removed in release 4.0.0.
|
getNamespace, getTable, with, withNamespace, withTable
@Inject public GrpcTransactionManager(DatabaseConfig databaseConfig)
public GrpcTransaction start() throws TransactionException
DistributedTransactionManager
DistributedTransaction
TransactionException
- if starting the transaction failedpublic GrpcTransaction start(java.lang.String txId) throws TransactionException
DistributedTransactionManager
txId
- an user-provided unique transaction IDDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(Isolation isolation) throws TransactionException
DistributedTransactionManager
Isolation
level.isolation
- an isolation levelDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(java.lang.String txId, Isolation isolation) throws TransactionException
DistributedTransactionManager
Isolation
level. It is
users' responsibility to guarantee uniqueness of the ID so it is not recommended to use this
method unless you know exactly what you are doing.txId
- an user-provided unique transaction IDisolation
- an isolation levelDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(Isolation isolation, SerializableStrategy strategy) throws TransactionException
DistributedTransactionManager
Isolation
level and SerializableStrategy
. If the isolation is not SERIALIZABLE, the serializable strategy is
ignored.isolation
- an isolation levelstrategy
- a serializable strategyDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(SerializableStrategy strategy) throws TransactionException
DistributedTransactionManager
SerializableStrategy
.strategy
- a serializable strategyDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(java.lang.String txId, SerializableStrategy strategy) throws TransactionException
DistributedTransactionManager
SerializableStrategy
. It is users' responsibility to guarantee uniqueness
of the ID so it is not recommended to use this method unless you know exactly what you are
doing.txId
- an user-provided unique transaction IDstrategy
- a serializable strategyDistributedTransaction
TransactionException
- if starting the transaction failed@Deprecated public GrpcTransaction start(java.lang.String txId, Isolation isolation, SerializableStrategy strategy) throws TransactionException
DistributedTransactionManager
Isolation
level and SerializableStrategy
. It is users' responsibility to guarantee uniqueness of the ID so it is
not recommended to use this method unless you know exactly what you are doing. If the isolation
is not SERIALIZABLE, the serializable strategy is ignored.txId
- an user-provided unique transaction IDisolation
- an isolation levelstrategy
- a serializable strategyDistributedTransaction
TransactionException
- if starting the transaction failedpublic TransactionState getState(java.lang.String txId) throws TransactionException
DistributedTransactionManager
txId
- a transaction IDTransactionState
TransactionException
- if getting the state of a given transaction failedpublic TransactionState abort(java.lang.String txId) throws TransactionException
DistributedTransactionManager
txId
- a transaction IDTransactionState
TransactionException
- if aborting the given transaction failedpublic void close()
DistributedTransactionManager