Class GlobalTxTable
The transaction state is stored in TxState, and that is stored in a replicated cache. The TxState
must be updated before performing any action in the transaction (prepare, commit, etc.).
In addition, since we don't have a client crash notification, it performs a reaper work, periodically, that cleanups idle transactions. The transaction is considered idle based on the timeout sent by the client. If no decision is made, it rollbacks the transaction. If the transaction is completed (committed or rolled-back), it is removed from the cache. If the transaction is decided (i.e. marked for commit or rollback), it completes the transaction.
Note that, recoverable transactions (transactions originated from FULL_XA support caches) aren't touched by the reaper. The recovery process is responsible to handle them.
- Since:
- 9.4
- Author:
- Pedro Ruivo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforgetTransaction(XidImpl xid) booleanisEmpty()voidmarkToCommit(XidImpl xid, CacheNameCollector collector) voidmarkToRollback(XidImpl xid, CacheNameCollector collector) voidvoidrun()periodically checks for idle transactions and rollbacks them.voidstart()Invoked on component startvoidstop()Invoked on component stopupdate(CacheXid key, TxFunction function, long timeoutMillis)
-
Constructor Details
-
GlobalTxTable
-
-
Method Details
-
start
public void start()Description copied from interface:LifecycleInvoked on component start -
stop
public void stop()Description copied from interface:LifecycleInvoked on component stop -
update
-
markToCommit
-
markToRollback
-
getState
-
remove
-
forgetTransaction
-
run
public void run()periodically checks for idle transactions and rollbacks them. -
getPreparedTransactions
-
isEmpty
public boolean isEmpty()
-