类 UserTransactionAdapter
- java.lang.Object
- org.springframework.transaction.jta.UserTransactionAdapter
- 所有已实现的接口:
UserTransaction
public class UserTransactionAdapter extends Object implements UserTransaction
Adapter for a JTA UserTransaction handle, taking a JTATransactionManager
reference and creating a JTAUserTransaction
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.- 从以下版本开始:
- 1.1.5
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 UserTransactionAdapter(TransactionManager transactionManager)
Create a new UserTransactionAdapter for the given TransactionManager.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
begin()
void
commit()
int
getStatus()
TransactionManager
getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.void
rollback()
void
setRollbackOnly()
void
setTransactionTimeout(int timeout)
构造器详细资料
UserTransactionAdapter
public UserTransactionAdapter(TransactionManager transactionManager)
Create a new UserTransactionAdapter for the given TransactionManager.- 参数:
transactionManager
- the JTA TransactionManager to wrap
方法详细资料
getTransactionManager
public final TransactionManager getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.
setTransactionTimeout
public void setTransactionTimeout(int timeout) throws SystemException
- 指定者:
setTransactionTimeout
在接口中UserTransaction
- 抛出:
SystemException
begin
public void begin() throws NotSupportedException, SystemException
commit
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException
rollback
public void rollback() throws SecurityException, SystemException
setRollbackOnly
public void setRollbackOnly() throws SystemException
- 指定者:
setRollbackOnly
在接口中UserTransaction
- 抛出:
SystemException
getStatus
public int getStatus() throws SystemException
- 指定者:
getStatus
在接口中UserTransaction
- 抛出:
SystemException