public class UserTransactionAdapter
extends java.lang.Object
implements javax.transaction.UserTransaction
TransactionManager
reference and creating
a JTA UserTransaction
handle for it.
The JTA UserTransaction interface is an exact subset of the JTA TransactionManager interface. Unfortunately, it does not serve as super-interface of TransactionManager, though, which requires an adapter such as this class to be used when intending to talk to a TransactionManager handle through the UserTransaction interface.
Used internally by Spring's JtaTransactionManager
for certain
scenarios. Not intended for direct use in application code.
Constructor and Description |
---|
UserTransactionAdapter(javax.transaction.TransactionManager transactionManager)
Create a new UserTransactionAdapter for the given TransactionManager.
|
Modifier and Type | Method and Description |
---|---|
void |
begin() |
void |
commit() |
int |
getStatus() |
javax.transaction.TransactionManager |
getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.
|
void |
rollback() |
void |
setRollbackOnly() |
void |
setTransactionTimeout(int timeout) |
public UserTransactionAdapter(javax.transaction.TransactionManager transactionManager)
transactionManager
- the JTA TransactionManager to wrappublic final javax.transaction.TransactionManager getTransactionManager()
public void setTransactionTimeout(int timeout) throws javax.transaction.SystemException
setTransactionTimeout
in interface javax.transaction.UserTransaction
javax.transaction.SystemException
public void begin() throws javax.transaction.NotSupportedException, javax.transaction.SystemException
begin
in interface javax.transaction.UserTransaction
javax.transaction.NotSupportedException
javax.transaction.SystemException
public void commit() throws javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException
commit
in interface javax.transaction.UserTransaction
javax.transaction.RollbackException
javax.transaction.HeuristicMixedException
javax.transaction.HeuristicRollbackException
java.lang.SecurityException
javax.transaction.SystemException
public void rollback() throws java.lang.SecurityException, javax.transaction.SystemException
rollback
in interface javax.transaction.UserTransaction
java.lang.SecurityException
javax.transaction.SystemException
public void setRollbackOnly() throws javax.transaction.SystemException
setRollbackOnly
in interface javax.transaction.UserTransaction
javax.transaction.SystemException
public int getStatus() throws javax.transaction.SystemException
getStatus
in interface javax.transaction.UserTransaction
javax.transaction.SystemException
Copyright © 2021. All rights reserved.