public class TransactionEventProxyImpl extends Object implements TransactionProxy, Externalizable
TransactionStateChangedEvent,
Serialized Form| Constructor and Description |
|---|
TransactionEventProxyImpl()
Default constructor (required by Externalizable).
|
TransactionEventProxyImpl(GridNearTxLocal tx) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Ends the transaction.
|
void |
commit()
Commits this transaction by initiating
two-phase-commit process. |
IgniteFuture<Void> |
commitAsync()
Asynchronously commits this transaction by initiating
two-phase-commit process. |
TransactionConcurrency |
concurrency()
Cache transaction concurrency mode.
|
<R> IgniteFuture<R> |
future()
Gets and resets future for previous asynchronous operation.
|
boolean |
implicit()
Flag indicating whether transaction was started automatically by the
system or not.
|
boolean |
isAsync() |
boolean |
isInvalidate()
Get invalidation flag for this transaction.
|
TransactionIsolation |
isolation()
Cache transaction isolation level.
|
boolean |
isRollbackOnly()
If transaction was marked as rollback-only.
|
@Nullable String |
label()
Returns transaction's label.
|
UUID |
nodeId()
ID of the node on which this transaction started.
|
void |
readExternal(ObjectInput in) |
void |
resume()
Resume a transaction if it was previously suspended.
|
void |
rollback()
Rolls back this transaction.
|
IgniteFuture<Void> |
rollbackAsync()
Asynchronously rolls back this transaction.
|
boolean |
setRollbackOnly()
Modify the transaction associated with the current thread such that the
only possible outcome of the transaction is to roll back the
transaction.
|
long |
startTime()
Start time of this transaction.
|
TransactionState |
state()
Gets current transaction state value.
|
void |
suspend()
Suspends a transaction.
|
long |
threadId()
ID of the thread in which this transaction started.
|
long |
timeout()
Gets timeout value in milliseconds for this transaction.
|
long |
timeout(long timeout)
Sets transaction timeout value.
|
IgniteAsyncSupport |
withAsync()
Gets instance of this component with asynchronous mode enabled.
|
void |
writeExternal(ObjectOutput out) |
IgniteUuid |
xid()
Gets unique identifier for this transaction.
|
public TransactionEventProxyImpl()
public TransactionEventProxyImpl(GridNearTxLocal tx)
tx - Tx proxy.public IgniteUuid xid()
xid in interface Transactionpublic UUID nodeId()
nodeId in interface Transactionpublic long threadId()
threadId in interface Transactionpublic long startTime()
startTime in interface Transactionpublic TransactionIsolation isolation()
isolation in interface Transactionpublic TransactionConcurrency concurrency()
concurrency in interface Transactionpublic boolean implicit()
put(..) or remove(..) operation is invoked
outside of transaction.implicit in interface TransactionTrue if transaction was started implicitly.public boolean isInvalidate()
true, then
remote values will be invalidated (set to null) instead
of updated.
Invalidation messages don't carry new values, so they are a lot lighter than update messages. However, when a value is accessed on a node after it's been invalidated, it must be loaded from persistent store.
isInvalidate in interface Transactionpublic TransactionState state()
state in interface Transactionpublic long timeout()
TransactionTimeoutException will be thrown.timeout in interface Transactionpublic long timeout(long timeout)
timeout in interface Transactiontimeout - Transaction timeout value.public boolean setRollbackOnly()
setRollbackOnly in interface TransactionTrue if rollback-only flag was set as a result of this operation,
false if it was already set prior to this call or could not be set
because transaction is already finishing up committing or rolling back.public boolean isRollbackOnly()
isRollbackOnly in interface TransactionTrue if transaction can only be rolled back.public void commit()
throws IgniteException
two-phase-commit process.commit in interface TransactionIgniteException - If commit failed.TransactionTimeoutException - If transaction is timed out.TransactionRollbackException - If transaction is automatically rolled back.TransactionOptimisticException - If transaction concurrency is TransactionConcurrency.OPTIMISTIC
and commit is optimistically failed.TransactionHeuristicException - If transaction has entered an unknown state.public IgniteFuture<Void> commitAsync() throws IgniteException
two-phase-commit process.commitAsync in interface TransactionIgniteException - If commit failed.TransactionTimeoutException - If transaction is timed out.TransactionRollbackException - If transaction is manually/automatically rolled back.TransactionOptimisticException - If transaction concurrency is TransactionConcurrency.OPTIMISTIC
and commit is optimistically failed.TransactionHeuristicException - If transaction has entered an unknown state.public void close()
throws IgniteException
close in interface AutoCloseableclose in interface TransactionIgniteException - If transaction could not be gracefully ended.public void rollback()
throws IgniteException
rollback in interface TransactionIgniteException - If rollback failed.public IgniteFuture<Void> rollbackAsync() throws IgniteException
rollbackAsync in interface TransactionIgniteException - If rollback failed.public void resume()
throws IgniteException
resume in interface TransactionIgniteException - If resume failed.public void suspend()
throws IgniteException
suspend in interface TransactionIgniteException - If suspension failed.@Nullable public @Nullable String label()
Use IgniteTransactions.withLabel(java.lang.String) to assign a label to a newly created transaction.
label in interface Transactionpublic IgniteAsyncSupport withAsync()
withAsync in interface IgniteAsyncSupportpublic boolean isAsync()
isAsync in interface IgniteAsyncSupportTrue if asynchronous mode is enabled.public <R> IgniteFuture<R> future()
future in interface IgniteAsyncSupportpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020