Package oracle.tmm.jta
Class TrmUserTransaction
java.lang.Object
oracle.tmm.jta.TrmUserTransaction
- All Implemented Interfaces:
javax.transaction.UserTransaction
The OTMM(MicroTx) user transaction defines the methods that allow an application to explicitly
manage transaction boundaries.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
boolean
int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
Creates a new transaction and associates it with the current thread.void
void
commit()
Commit the transaction associated with the current thread.int
Obtain the status of the transaction associated with the current thread.Get OTMM(MicroTx) user transaction ID associated with the current threadGet OTMM(MicroTx) user transaction external URLGet OTMM(MicroTx) user transaction internal URLvoid
resume()
Resume the transaction.void
rollback()
Roll back the transaction associated with the current thread.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.void
Start the Golbal Transaction with the TCSvoid
suspend()
Suspend the transaction.
-
Field Details
-
gtrid
-
txnUrl
-
txnInternalUrl
-
txnExternalUrl
-
timeout
public int timeout -
rollbackOnly
public boolean rollbackOnly -
suspended
public boolean suspended -
insProperties
-
-
Constructor Details
-
TrmUserTransaction
public TrmUserTransaction()Initialize a new OTMM(MicroTx) user transaction
-
-
Method Details
-
begin
Creates a new transaction and associates it with the current thread.- Specified by:
begin
in interfacejavax.transaction.UserTransaction
- Throws:
IllegalStateException
- The IllegalStateException is thrown to indicate the method is invoked at a wrong timejavax.transaction.SystemException
- The SystemException is thrown to indicate the OTMM(MicroTx) has encountered an unexpected error condition
-
begin
- Throws:
IllegalStateException
javax.transaction.SystemException
-
startTCSGlobalTransaction
public void startTCSGlobalTransaction() throws IllegalStateException, javax.transaction.SystemExceptionStart the Golbal Transaction with the TCS- Throws:
IllegalStateException
javax.transaction.SystemException
-
commit
public void commit() throws javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, SecurityException, IllegalStateException, javax.transaction.SystemExceptionCommit the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.- Specified by:
commit
in interfacejavax.transaction.UserTransaction
- Throws:
javax.transaction.RollbackException
- - Thrown to indicate that the transaction has been rolled back rather than committed based on status/exception returned by transaction coordinator.javax.transaction.HeuristicMixedException
- - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back based on status/exception returned by transaction coordinator.javax.transaction.HeuristicRollbackException
- - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back based on status/exception returned by transaction coordinator.SecurityException
- - Thrown to indicate that the thread is not allowed to commit the transaction.IllegalStateException
- - Thrown if the current thread is not associated with a transaction.javax.transaction.SystemException
- - Thrown if an unexpected error condition is encountered.
-
rollback
public void rollback() throws IllegalStateException, SecurityException, javax.transaction.SystemExceptionRoll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.- Specified by:
rollback
in interfacejavax.transaction.UserTransaction
- Throws:
SecurityException
- - Thrown to indicate that the thread is not allowed to commit the transaction.IllegalStateException
- - Thrown if the current thread is not associated with a transaction.javax.transaction.SystemException
- - Thrown if an unexpected error condition is encountered.
-
suspend
Suspend the transaction. This affects only the local transaction state. This is intended to ensure that the client jax-rs filter for outgoing requests do not perform transaction.- Throws:
IllegalStateException
- Thrown 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 jax-rs filter for outgoing requests starts performing transaction specific operations again.- Throws:
IllegalStateException
- Thrown if the current thread is not associated with a transaction.
-
getTransactionID
Get OTMM(MicroTx) user transaction ID associated with the current thread- Returns:
- returns the GTRID.
- Throws:
IllegalStateException
- Thrown if the current UserTransaction instance/object has not been used to begin 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
- - Thrown if the current thread is not associated with a transaction.
-
getStatus
public int getStatus() throws javax.transaction.SystemExceptionObtain the status of the transaction associated with the current thread.- Specified by:
getStatus
in interfacejavax.transaction.UserTransaction
- Returns:
- Returns transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.
- Throws:
javax.transaction.SystemException
- - Thrown if an unexpected error condition is encountered.
-
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
Get OTMM(MicroTx) user transaction internal URL- Returns:
- OTMM(MicroTx) user transaction internal URL
- Throws:
IllegalStateException
- The IllegalStateException is thrown to indicate the method is invoked at a wrong time
-
getTxnExternalUrl
Get OTMM(MicroTx) user transaction external URL- Returns:
- OTMM(MicroTx) user transaction external URL
- Throws:
IllegalStateException
- The IllegalStateException is thrown to indicate the method is invoked at a wrong time
-
getTxnUrl
- Throws:
IllegalStateException
-
setProperty
-