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.Logger
protected static final String
protected boolean
protected boolean
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet OTMM(MicroTx) user transaction ID associated with the current threadint
abstract void
resume()
Resume the transaction.void
setInsProperties
(Map<String, Object> insProperties) void
setProperty
(String propertyName, Object propertyValue) void
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.void
setTransactionTimeout
(int timeout) Modify the timeout value that is associated with transactions started by the current thread with the begin method.abstract void
Start the transaction with a Unique Identifier.abstract void
suspend()
Suspend the transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.SystemException
IllegalStateException
- .
-
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:
setRollbackOnly
in interfacejakarta.transaction.UserTransaction
- Throws:
IllegalStateException
- If the current thread is not associated with a transaction.
-
setTransactionTimeout
public void setTransactionTimeout(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:
setTransactionTimeout
in interfacejakarta.transaction.UserTransaction
- Parameters:
timeout
- The value of the timeout in seconds. 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
-