Package com.oracle.microtx.xa.rm
Class MicroTxUserTransaction
java.lang.Object
com.oracle.microtx.xa.rm.MicroTxUserTransaction
- All Implemented Interfaces:
javax.transaction.UserTransaction
public abstract class MicroTxUserTransaction
extends Object
implements javax.transaction.UserTransaction
The MicroTx user transaction abstract class defines the methods that allow an application to explicitly
manage transaction boundaries.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet OTMM(MicroTx) user transaction ID associated with the current threadabstract void
resume()
Resume the transaction.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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.transaction.UserTransaction
begin, commit, getStatus, rollback
-
Field Details
-
gtrid
-
txnUrl
-
txnInternalUrl
-
txnExternalUrl
-
-
Constructor Details
-
MicroTxUserTransaction
public MicroTxUserTransaction()
-
-
Method Details
-
startTCSGlobalTransaction
public abstract void startTCSGlobalTransaction() throws IllegalStateException, javax.transaction.SystemExceptionStart the transaction with a Unique Identifier. This is intended to ensure that the transaction is globally identifiable.- Throws:
javax.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 interfacejavax.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 interfacejavax.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.
-
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
-