Package com.j_spaces.core.transaction
Class TransactionHandler
java.lang.Object
com.j_spaces.core.transaction.TransactionHandler
Handle engine transactions
- Since:
- 6.0
- Author:
- anna
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddToPrepared2PCXtns(XtnEntry xtnEntry) voidaddTransaction(XtnEntry xtnEntry) addTransactionIfAbsent(XtnEntry xtnEntry) attachToXtnGranular(ServerTransaction txn, boolean fromReplication) Join the specified transaction, if not already joined.voidCreate new TransactionEntry and add it to the list of managed transactionscreateTransactionEntryIfAbsent(ServerTransaction txn, XtnEntry newXtnEntry) Create new TransactionEntry and add it to the list of managed transactions if such xtn does not exist.static longstatic longstatic intstatic longGet the transaction entry for given transaction.intbooleanisLightTransaction(XtnEntry xtnEntry) booleanstatic booleanbooleanlockXtnOnXtnEnd(XtnEntry xtnEntry) xtn is ending (rollbak/commit) - lock + fifo lock if fifo entries in xtnvoidvoidvoidremoveTransactionAfterEnd(XtnEntry xtnEntry) Remove given transaction from handled transactionsvoidremoveUnusedTransaction(XtnEntry xtnEntry, boolean needLock) Remove an unused transaction from handled transactionsbooleanremoveXtnEntry(ServerTransaction key, XtnEntry value) voidrenewTransactionLease(ServerTransaction txn, long time) voidunlockXtnOnXtnEnd(XtnEntry xtnEntry, boolean lockedXtnTable) booleanwaitForActiveTransactions(long timeoutInMillis) booleanwaitForFinalizingTransactions(long timeoutInMillis) voidxtnLockEntryOnTemplateOperation(Context context, IEntryHolder eh, ITemplateHolder th, XtnEntry alreadyLockedXtn) /** given an entry + template- perform the xtn locks and set the appropriatevoidxtnUnlockEntryOnTemplateOperation(ITemplateHolder th, XtnEntry alreadyLockedXtn)
-
Field Details
-
XTN_ADDITIONAL_TIMEOUT
public static final long XTN_ADDITIONAL_TIMEOUT
-
-
Constructor Details
-
TransactionHandler
-
-
Method Details
-
getXtnTable
- Returns:
- the xtnTable
-
removeXtnEntry
-
removeXtnEntry
-
getTimedXtns
- Returns:
- the timedLocalXtns
-
getPhantomGlobalXtns
-
getTxWriteLock
-
getTxReadLock
-
addTransaction
-
addTransactionIfAbsent
-
removeTransactionAfterEnd
Remove given transaction from handled transactions -
removeUnusedTransaction
Remove an unused transaction from handled transactions -
createTransactionEntry
Create new TransactionEntry and add it to the list of managed transactions- Returns:
- XtnEntry
-
createTransactionEntryIfAbsent
Create new TransactionEntry and add it to the list of managed transactions if such xtn does not exist. if it exists=return it- Parameters:
newXtnEntry- - to be inserted if absent- Returns:
- XtnEntry
-
renewTransactionLease
-
getUnusedXtnCleanTime
public int getUnusedXtnCleanTime() -
getTransactionEntry
Get the transaction entry for given transaction. Check if transaction is valid- Returns:
- XtnEntry
- Throws:
TransactionException
-
attachToXtnGranular
public XtnEntry attachToXtnGranular(ServerTransaction txn, boolean fromReplication) throws TransactionException, RemoteException Join the specified transaction, if not already joined.- Parameters:
txn- the transaction to join- Throws:
TransactionExceptionRemoteException
-
xtnLockEntryOnTemplateOperation
public void xtnLockEntryOnTemplateOperation(Context context, IEntryHolder eh, ITemplateHolder th, XtnEntry alreadyLockedXtn) /** given an entry + template- perform the xtn locks and set the appropriate- Parameters:
alreadyLockedXtn- - if an encapsulating xtn was already locked (for example in takemultiple)
-
xtnUnlockEntryOnTemplateOperation
-
lockXtnOnXtnEnd
xtn is ending (rollbak/commit) - lock + fifo lock if fifo entries in xtn -
unlockXtnOnXtnEnd
-
isLightTransaction
-
isPhantomGlobalXtn
-
addToPhantomGlobalXtns
-
removeFromPhantomGlobalXtns
-
getBasicTimeForPreparedXtn
public static long getBasicTimeForPreparedXtn() -
isSupportsPreparedXtnsExtentionTime
public static boolean isSupportsPreparedXtnsExtentionTime() -
getExtentionTimeForPreparedXtn
public static long getExtentionTimeForPreparedXtn() -
getMaxNumberOfPreaparedXtnExtentions
public static int getMaxNumberOfPreaparedXtnExtentions() -
addToPrepared2PCXtns
-
removeFromPrepared2PCXtns
-
getPrepared2PCXtns
-
getTimeToWaitForTm
public static long getTimeToWaitForTm() -
checkTransactionDisconnection
public void checkTransactionDisconnection(OperationID opid, ServerTransaction txn) throws TransactionException - Throws:
TransactionException
-
waitForActiveTransactions
- Throws:
InterruptedException
-
waitForFinalizingTransactions
- Throws:
InterruptedException
-