Package com.oracle.microtx.xa.rm
Class MicroTxUserTransaction
java.lang.Object
com.oracle.microtx.xa.rm.MicroTxUserTransaction
- All Implemented Interfaces:
jakarta.transaction.UserTransaction
- Direct Known Subclasses:
MicroTxUserTransactionService
public abstract class MicroTxUserTransaction
extends Object
implements jakarta.transaction.UserTransaction
The MicroTx user transaction abstract class defines the methods that allow an application to explicitly
manage transaction boundaries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerprotected static final Stringprotected booleanprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet OTMM(MicroTx) user transaction ID associated with the current threadintabstract voidresume()Resume the transaction.voidsetInsProperties<wbr>(Map<String,<wbr>Object> insProperties)voidsetProperty<wbr>(String propertyName, Object propertyValue)voidModify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.voidsetTransactionTimeout<wbr>(int timeout)Modify the timeout value that is associated with transactions started by the current thread with the begin method.abstract voidStart the transaction with a Unique Identifier.abstract voidsuspend()Suspend the transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.transaction.UserTransaction
begin, commit, getStatus, rollback
-
Field Details
-
gtrid
-
txnUrl
-
txnInternalUrl
-
txnExternalUrl
-
timeout
protected int timeout -
rollbackOnly
protected boolean rollbackOnly -
suspended
protected boolean suspended -
NO_TX_CUR_THREAD
- See Also:
-
insProperties
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
MicroTxUserTransaction
public MicroTxUserTransaction()
-
-
Method Details
-
startTCSGlobalTransaction
public abstract void startTCSGlobalTransaction() throws IllegalStateException, jakarta.transaction.SystemExceptionStart the transaction with a Unique Identifier. This is intended to ensure that the transaction is globally identifiable.- Throws:
jakarta.transaction.SystemExceptionIllegalStateException- .
-
suspend
Suspend the transaction. This affects only the local transaction state. This is intended to ensure that the client filters for outgoing requests do not perform transaction.- Throws:
IllegalStateException- If the current thread is not associated with a transaction.
-
resume
Resume the transaction. This affects only the local transaction state. This is intended to ensure that the client filters for outgoing requests starts performing transaction specific operations again.- Throws:
IllegalStateException- If the current thread is not associated with a transaction.
-
setRollbackOnly
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.- Specified by:
setRollbackOnlyin interfacejakarta.transaction.UserTransaction- Throws:
IllegalStateException- If the current thread is not associated with a transaction.
-
setTransactionTimeout
public void setTransactionTimeout<wbr>(int timeout)Modify the timeout value that is associated with transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.- Specified by:
setTransactionTimeoutin interfacejakarta.transaction.UserTransaction- Parameters:
timeout- The value of the timeout in milliseconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.
-
getTransactionTimeout
public int getTransactionTimeout() -
getTxnInternalUrl
- Throws:
IllegalStateException
-
getTxnExternalUrl
- Throws:
IllegalStateException
-
getTxnUrl
- Throws:
IllegalStateException
-
setProperty
-
getTransactionID
Get OTMM(MicroTx) user transaction ID associated with the current thread- Returns:
- returns the GTRID.
- Throws:
IllegalStateException- If the current UserTransaction instance/object has not been used to begin a transaction
-
getInsProperties
-
setInsProperties
-